const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CZkuZ58v.js","assets/ArticleCard-CbfpfMp1.js","assets/WaitlistForm-jTAaxztn.js","assets/Talks-DNYwXUqg.js","assets/nadaya-app-phone-CPGLewUq.js","assets/blog-B7mHKjBz.js","assets/contato-iFY3B6hM.js","assets/loja-E0SVObRb.js","assets/mentorias-CEOKd88I.js","assets/sobre-qDmxYUpO.js","assets/yogaterapia-e-AAVxcH.js"])))=>i.map(i=>d[i]); var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var ee=!1,S=-1,C=5,w=-1;function te(){return g?!0:!(e.unstable_now()-wt&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?re():ee=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,re()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1pe||(e.current=fe[pe],fe[pe]=null,pe--)}function A(e,t){pe++,fe[pe]=e.current,e.current=t}var me=O(null),he=O(null),ge=O(null),_e=O(null);function ve(e,t){switch(A(ge,t),A(he,e),A(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}k(me),A(me,e)}function ye(){k(me),k(he),k(ge)}function be(e){e.memoizedState!==null&&A(_e,e);var t=me.current,n=Jd(t,e.type);t!==n&&(A(he,e),A(me,n))}function xe(e){he.current===e&&(k(me),k(he)),_e.current===e&&(k(_e),rp._currentValue=de)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function et(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rt(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.textContent,a=i.length;for(e=0;e=nr),ir=` `,ar=!1;function or(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function M(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return M(t);case`keypress`:return t.which===32?(ar=!0,ir):null;case`textInput`:return e=t.data,e===ir&&ar?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!tr&&or(e,t)?(e=wn(),Cn=Sn=xn=null,sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gt(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=vn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Gt(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=jd(Rr,`onSelect`),0>=o,i-=o,Ni=1<<32-Ke(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&Fi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&Fi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&Fi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&Fi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Fa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ha(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=bi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=yi(o.type,o.key,o.props,null,e.mode,c),Ha(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}t(e,r),r=r.sibling}c=Ci(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Fa(o),b(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Va(o),c);if(o.$$typeof===S)return b(e,r,la(e,o),c);Ua(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=xi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ba=0;var i=b(e,t,n,r);return za=null,i}catch(t){if(t===ka||t===ja)throw t;var a=hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ga=Wa(!0),Ka=Wa(!1),qa=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,z&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=fi(e),di(e,null,n),t}return ci(e,r,t,n),fi(e)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}function $a(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var eo=!1;function to(){if(eo){var e=ba;if(e!==null)throw e}}function no(e,t,n,r){eo=!1;var i=e.updateQueue;qa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(H&f)===f:(r&f)===f){f!==0&&f===ya&&(eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:qa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function ro(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function io(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};E.T=s,Bs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,Ca(c,r),yu(e)):zs(e,t,r,yu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},yu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,de,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},yu())}function Ns(){return ca(rp)}function Ps(){return Ro().memoizedState}function Fs(){return Ro().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yu();e=Xa(n);var r=Za(t,e,n);r!==null&&(xu(r,t,n),Qa(r,t,n)),t={cache:ha()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=yu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=li(e,t,n,r),n!==null&&(xu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,yu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return ci(e,t,i,0),B===null&&si(),!1}catch{}if(n=li(e,t,i,r),n!==null)return xu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=li(e,n,r,2),t!==null&&xu(t,e,2)}function Vs(e){var t=e.alternate;return e===F||t!==null&&t===F}function Hs(e,t){So=xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var Ws={readContext:ca,use:Vo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};Ws.useEffectEvent=Oo;var Gs={readContext:ca,use:Vo,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),L(4194308,4,R.bind(null,t,e),n)},useLayoutEffect:function(e,t){return L(4194308,4,e,t)},useInsertionEffect:function(e,t){L(4,2,e,t)},useMemo:function(e,t){var n=Lo();t=t===void 0?null:t;var r=e();if(Co){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Lo();if(n!==void 0){var i=n(t);if(Co){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,n=Rs.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Lo(),e,t)},useTransition:function(){var e=$o(!1);return e=Os.bind(null,F,e.queue,!0,!1),Lo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,a=Lo();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),B===null)throw Error(i(349));H&127||Jo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,gs(Xo.bind(null,r,o,e),[e]),r.flags|=2048,ps(9,{destroy:void 0},Yo.bind(null,r,o,n,t),null),n},useId:function(){var e=Lo(),t=B.identifierPrefix;if(N){var n=Pi,r=Ni;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ht]=t,o[gt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&zc(t)}}return Wc(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,Ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Bi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Gi(t,!0)}else e=Kd(e).createTextNode(r),e[ht]=t,t.stateNode=e}return Wc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ji(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ht]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),e=!1}else n=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_o(t),t):(_o(t),null);if(t.flags&128)throw Error(i(558))}return Wc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ht]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),a=!1}else a=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(_o(t),t):(_o(t),null)}return _o(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hc(t,t.updateQueue),Wc(t),null);case 4:return ye(),e===null&&Dd(t.stateNode.containerInfo),Wc(t),null;case 10:return na(t.type),Wc(t),null;case 19:if(k(P),r=t.memoizedState,r===null)return Wc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null)if(a)Uc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,Uc(r,!1),e=o.updateQueue,t.updateQueue=e,Hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vi(n,e),n=n.sibling;return A(P,P.current&1|2),N&&Fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>cu&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}else{if(!a)if(e=vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hc(t,e),Uc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return Wc(t),null}else 2*Pe()-r.renderingStartTime>cu&&n!==536870912&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Wc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=P.current,A(P,a?n&1|2:n&1),N&&Fi(t,r.treeForkCount),e);case 22:case 23:return _o(t),lo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Wc(t),t.subtreeFlags&6&&(t.flags|=8192)):Wc(t),n=t.updateQueue,n!==null&&Hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&k(Ta),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),na(ma),Wc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Kc(e,t){switch(Ri(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(ma),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(_o(t),t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_o(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(P),null;case 4:return ye(),null;case 10:return na(t.type),null;case 22:case 23:return _o(t),lo(),e!==null&&k(Ta),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(ma),null;case 25:return null;default:return null}}function qc(e,t){switch(Ri(t),t.tag){case 3:na(ma),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&_o(t);break;case 13:_o(t);break;case 19:k(P);break;case 10:na(t.type);break;case 22:case 23:_o(t),lo(),e!==null&&k(Ta);break;case 24:na(ma)}}function Jc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){K(t,t.return,e)}}function Yc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){K(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){K(t,t.return,e)}}function Xc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{io(t,n)}catch(t){K(e,e.return,t)}}}function Zc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){K(e,t,n)}}function Qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){K(e,t,n)}}function $c(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){K(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){K(e,t,n)}else n.current=null}function el(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){K(e,e.return,t)}}function tl(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[gt]=t}catch(t){K(e,e.return,t)}}function nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[ht]=e,t[gt]=n}catch(t){K(e,e.return,t)}}var sl=!1,cl=!1,ll=!1,ul=typeof WeakSet==`function`?WeakSet:Set,dl=null;function fl(e,t){if(e=e.containerInfo,Wd=fp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},fp=!1,dl=t;dl!==null;)if(t=dl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,dl=e;else for(;dl!==null;){switch(t=dl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Bd(o,r,n),o[ht]=e,Ot(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,E.T=null,n=hu,hu=null;var o=du,s=pu;if(G=0,fu=du=null,pu=0,z&6)throw Error(i(331));var c=z;if(z|=4,Hl(o.current),Pl(o,o.current,s,n),z=c,ud(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{D.p=a,E.T=r,qu(e,t)}}function Xu(e,t,n){t=Ti(n,t),t=ic(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(at(e,2),ld(e))}function K(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(uu===null||!uu.has(r))){e=Ti(n,e),n=ac(2),r=Za(t,n,2),r!==null&&(oc(n,r,t,e),at(r,2),ld(r));break}}t=t.return}}function Zu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=Qu.bind(null,e,t,n),t.then(e,e))}function Qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,B===e&&(H&n)===n&&(Zl===4||Zl===3&&(H&62914560)===H&&300>Pe()-ou?!(z&2)&&Ou(e,0):eu|=n,nu===H&&(nu=0)),ld(e)}function $u(e,t){t===0&&(t=rt()),e=ui(e,t),e!==null&&(at(e,t),ld(e))}function ed(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$u(e,n)}function td(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$u(e,n)}function nd(e,t){return Ae(e,t)}var rd=null,id=null,ad=!1,od=!1,sd=!1,cd=0;function ld(e){e!==id&&e.next===null&&(id===null?rd=id=e:id=id.next=e),od=!0,ad||(ad=!0,hd())}function ud(e,t){if(!sd&&od){sd=!0;do for(var n=!1,r=rd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=H,a=et(r,r===B?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,md(r,a));r=r.next}while(n);sd=!1}}function dd(){fd()}function fd(){od=ad=!1;var e=0;cd!==0&&Zd()&&(e=cd);for(var t=Pe(),n=null,r=rd;r!==null;){var i=r.next,a=q(r,t);a===0?(r.next=null,n===null?rd=i:n.next=i,i===null&&(id=n)):(n=r,(e!==0||a&3)&&(od=!0)),r=i}G!==0&&G!==5||ud(e,!1),cd!==0&&(cd=0)}function q(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=Dt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);Ot(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=Dt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=h({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),Ot(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=Dt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),Ot(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=ge.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=Dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=Dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=Dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+qt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),Ot(t),e.head.appendChild(t))}function zf(e){return`[src="`+qt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Bd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,Ot(a),a):(r=n,(a=yf.get(o))&&(r=h({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=`__TSS_CONTEXT`,v=Symbol.for(`TSS_SERVER_FUNCTION`),y=`application/x-tss-framed`,b={JSON:0,CHUNK:1,END:2,ERROR:3};`${y}`;var x=/;\s*v=(\d+)/;function ee(e){let t=e.match(x);return t?parseInt(t[1],10):void 0}function S(e){let t=ee(e);if(t!==void 0&&t!==1)throw Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var C=()=>window.__TSS_START_OPTIONS__;function w(e){return e[e.length-1]}function te(e){return typeof e==`function`}function ne(e,t){return te(e)?e(t):e}var re=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;function ae(e){for(let t in e)if(re.call(e,t))return!0;return!1}var oe=()=>Object.create(null),se=(e,t)=>ce(e,t,oe);function ce(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=D(e)&&D(i);if(!a&&!(ue(e)&&ue(i)))return i;let o=a?e:le(e);if(!o)return i;let s=a?i:le(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!de(e[o],t[o],n)))return!1;return i===a}return!1}function fe(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function pe(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function O(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var k=/[\x00-\x1f\x7f"<>`{}]/g;function A(e){return e.replace(k,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function me(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return A(t)}var he=[`http:`,`https:`,`mailto:`,`tel:`];function ge(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var _e={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ve=/[&><\u2028\u2029]/g;function ye(e){return e.replace(ve,e=>_e[e])}function be(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=me(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=me(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function xe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Se(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Te=4,Ee=5;function De(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Oe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=De(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ne(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ne(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ne(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Me(n.fullPath??n.from);e.kind=Ee,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Me(n.fullPath??n.from);e.kind=Te,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)ke(e,t,r,s,i,a,o)}function Ae(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function je(e){if(e.pathless)for(let t of e.pathless)je(t);if(e.static)for(let t of e.static.values())je(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())je(t);if(e.dynamic?.length){e.dynamic.sort(Ae);for(let t of e.dynamic)je(t)}if(e.optional?.length){e.optional.sort(Ae);for(let t of e.optional)je(t)}if(e.wildcard?.length){e.wildcard.sort(Ae);for(let t of e.wildcard)je(t)}}function Me(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Ne(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Pe(e,t){let n=Me(`/`),r=new Uint16Array(6);for(let t of e)ke(!1,r,t,1,n,0);je(n),t.masksTree=n,t.flatCache=we(1e3)}function Fe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Be(e,t.masksTree);return t.flatCache.set(e,r),r}function Ie(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Me(`/`),ke(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Be(r,o,n)}function Le(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Be(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=He(a.route)),t.matchCache.set(r,a),a}function Re(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function ze(e,t=!1,n){let r=Me(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return ke(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Ce(),a[e.id]=e,s!==0&&e.path){let t=Re(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),je(r),{processedTree:{segmentTree:r,singleCache:we(1e3),matchCache:we(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Be(e,t,n=!1){let r=e.split(`/`),i=We(e,r,t,n);if(!i)return null;let[a]=Ve(e,r,i);return{route:i.node.route,rawParams:a}}function Ve(e,t,n){let r=Ue(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+Ge(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+Ge(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Ge(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Ge(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Te)>(e.node.kind===Te)||t.node.kind===Te==(e.node.kind===Te)&&t.depth>e.depth)))}function Ye(e){return Xe(e.filter(e=>e!==void 0).join(`/`))}function Xe(e){return e.replace(/\/{2,}/g,`/`)}function Ze(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Qe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function $e(e){return Qe(Ze(e))}function et(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function tt(e,t,n){return et(e,n)===et(t,n)}function nt({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&w(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1&&(w(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Xe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function rt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function it(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>ot(e,n)).join(`/`):ot(r,n):r}function at({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;se.state.__TSR_key||e.href;function _t(e){let t=e.getAttribute(ht);if(t)return`[${ht}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var vt=!1,yt=`window`;function bt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function xt(e){let t=new Set;for(let n of e){if(n===yt)continue;let e=bt(n);e&&t.add(e)}return t}function St(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||gt,a=new Set,o=e=>{let t=mt[e]||={};for(let e of a)e===document?t[yt]={scrollX,scrollY}:e.isConnected&&(t[_t(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,vt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{vt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),pt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=mt[d];if(e){let t=mt[u];for(let n in e){if(n===yt){if(s)continue}else{let e=bt(n);if(!e||s&&o&&(l??=xt(o),l.has(e)))continue}t||=mt[u]={},t[n]??=e[n]}}}vt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=xt(o));let t=e&&i&&c,s=r.restoring?mt[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===yt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=bt(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{vt=!1}}))}function Ct(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function wt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Tt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=wt(r):Array.isArray(t)?t.push(wt(r)):n[e]=[t,wt(r)]}return n}var Et=Ot(JSON.parse),Dt=kt(JSON.stringify,JSON.parse);function Ot(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Tt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function kt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Ct(e,r);return t?`?${t}`:``}}var At=`__root__`;function jt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Mt(e){return e instanceof Response&&!!e.options}function Nt(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return jt(e)}function Pt(e){return{input:({url:t})=>{for(let n of e)t=It(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Lt(e[n],t);return t}}}function Ft(e){let t=$e(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ye([`/`,t,e.pathname]),e)}}function It(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Lt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Rt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>zt(o,_.get())),x=r(()=>zt(s,v.get())),ee=r(()=>zt(c,y.get())),S=r(()=>_.get()[0]),C=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),w=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),te=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),ne=we(64);function re(e){let t=ne.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),ne.set(e,t)),t}let ie={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:ee,firstId:S,hasPending:C,matchRouteDeps:w,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:te,getRouteMatchStore:re,setMatches:ae,setPending:oe,setCached:se};ae(e.matches),a?.(ie);function ae(e){Bt(e,o,_,n,i)}function oe(e){Bt(e,s,v,n,i)}function se(e){Bt(e,c,y,n,i)}return ie}function zt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Bt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Se(n.get(),a)||n.set(a)})}var Vt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ht=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Ut=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Wt=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Gt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Kt=(e,t,n)=>{if(!(!Mt(n)&&!ct(n)))throw Mt(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Mt(n)?`redirected`:ct(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Wt(e,t.index),isFetching:!1,error:n})),ct(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Mt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},qt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Jt=(e,t,n)=>{let r=Wt(e,n);e.updateMatch(t,e=>({...e,context:r}))},Yt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Kt(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Kt(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Mt(n)&&!ct(n)&&(e.serialError??=n)},Xt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ut(e,t)&&(n.options.loader||n.options.beforeLoad||cn(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Vt(e)},i);r._nonReactive.pendingTimeout=t}},Zt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Xt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Kt(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Qt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=fe(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Yt(e,n,o),s&&Yt(e,n,s),Xt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=fe();let f={...Wt(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Ut(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Mt(r)||ct(r))&&(u(),Yt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),O(y))return u(),y.catch(t=>{Yt(e,n,t)}).then(v)}catch(t){u(),Yt(e,n,t)}v(y)},$t=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Qt(e,n,t,i),s=()=>{if(qt(e,n))return;let t=Zt(e,n,i);return O(t)?t.then(o):o()};return a()},en=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},tn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Wt(e,r),d=Ut(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},nn=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{sn(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(tn(e,t,n,r,i)),l=!!s&&O(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Kt(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Wt(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Wt(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,ct(t)&&await i.options.notFoundComponent?.preload?.(),Kt(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Kt(e,e.router.getMatch(n),t)}!Mt(o)&&!ct(o)&&await sn(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Wt(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Kt(e,r,t)}},rn=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(tn(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await nn(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Mt(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await nn(e,t,i,n,d):Jt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(qt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Jt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Ut(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Kt(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=fe(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function an(e){let t=e,n=[];Ht(t.router)&&Vt(t);let r;for(let e=0;e({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await sn(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await sn(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=en(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Vt(t);if(O(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function on(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function sn(e,t=ln){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===ln?(()=>{if(e._componentsPromise===void 0){let t=on(e,ln);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():on(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function cn(e){for(let t of ln)if(e.options[t]?.preload)return!0;return!1}var ln=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],un=`__TSR_index`,dn=`popstate`,fn=`beforeunload`;function pn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=_n(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[un];i=mn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[un];i=mn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[un]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function mn(e,t){t||={};let n=vn();return{...t,key:n,__TSR_key:n,[un]:e}}function hn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>_n(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=vn();t.history.replaceState({[un]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(S._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),S._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=_n(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),S.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[un]-l.state[un],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},ee=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=pn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(fn,ee,{capture:!0}),t.removeEventListener(dn,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(fn,ee,{capture:!0}),t.addEventListener(dn,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||b(`REPLACE`),n},S}function gn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function _n(e,t){let n=gn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=vn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[un]:0,key:a,__TSR_key:a}}}function vn(){return(Math.random()+1).toString(36).substring(7)}function yn(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function bn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var xn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=rt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:hn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=we(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Rt(wn(this.latestLocation),e),St(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=$e(o);t&&t!==`/`&&e.push(Ft({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Pt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ze(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Pe(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:be(e).path,external:!1,searchStr:o,search:se(t?.search,i),hash:be(r.slice(1)).path,state:ce(t?.state,a)}}let o=new URL(i,this.origin),s=It(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:be(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:se(t?.search,c),hash:be(s.hash.slice(1)).path,state:ce(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>nt({base:e,to:t.includes(`//`)?Xe(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>En({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,ne(t.params,s)),d=this.routesByPath[Qe(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&ae(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:be(at({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Tn(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Dn({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=se(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?ne(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?ne(t.state,n.state):{};v=ce(n.state,v);let y=`${p}${h}${_}`,b,x,ee=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Lt(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,ee=!0)}else b=xe(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:ee,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Fe(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,ne(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=de(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Qe(this.latestLocation.href)===Qe(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=fe(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=_n(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=It(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ge(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t&&(this._scroll.hash=t===`PUSH`||t===`REPLACE`);let n=this.latestLocation,r=bn(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await an({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Mt(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ct(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(bn(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ge(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??3e5;return t.status===`error`||e-t.updatedAt>=r}})},this.loadRouteChunk=sn,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await an({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Mt(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});ct(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Ie(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!de(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?de(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Dt,parseSearch:e.parseSearch??Et,protocolAllowlist:e.protocolAllowlist??he}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=He(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Qe(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?kn(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;nthis.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let t=w(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=w(r),o={...e.search};for(let e of r)try{Object.assign(o,Tn(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{An(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},Sn=class extends Error{},Cn=class extends Error{};function wn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Tn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Sn(`Async validation not supported`);if(n.issues)throw new Sn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function En({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Qe(e),a,o=Le(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Dn({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return On(n)(e,t,r??!1)}function On(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Tn(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=ne(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function kn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return At}function An(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var jn=Symbol.for(`TSR_DEFERRED_PROMISE`);function Mn(e,t){let n=e;return n[jn]?n:(n[jn]={status:`pending`},n.then(e=>{n[jn].status=`success`,n[jn].data=e}).catch(e=>{n[jn].status=`error`,n[jn].error={data:(t?.serializeError??yn)(e),__isServerError:!0}}),n)}var Nn=`Error preloading route! ☝️`;function Pn(e,t){if(e)return typeof e==`string`?e:e[t]}function Fn(e){return e?.scriptFormat??`module`}function In(e,t,n){let r=Ln(t),i=Pn(n,`script`)??r.crossOrigin;return{...Fn(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function Ln(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function Rn(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function zn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}var Bn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=At:this.parentRoute||Ce();let r=n?At:t?.path;r&&r!==`/`&&(r=Ze(r));let i=t?.id||r,a=n?At:Ye([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ye([`/`,a]));let o=a===`__root__`?`/`:Ye([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Qe(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>jt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Vn=class extends Bn{constructor(e){super(e)}},Hn=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(Hn||{}),Un=Symbol.asyncIterator,Wn=Symbol.hasInstance,Gn=Symbol.isConcatSpreadable,Kn=Symbol.iterator,qn=Symbol.match,Jn=Symbol.matchAll,Yn=Symbol.replace,Xn=Symbol.search,Zn=Symbol.species,Qn=Symbol.split,$n=Symbol.toPrimitive,er=Symbol.toStringTag,tr=Symbol.unscopables,nr={[Un]:0,[Wn]:1,[Gn]:2,[Kn]:3,[qn]:4,[Jn]:5,[Yn]:6,[Xn]:7,[Zn]:8,[Qn]:9,[$n]:10,[er]:11,[tr]:12},rr={0:Un,1:Wn,2:Gn,3:Kn,4:qn,5:Jn,6:Yn,7:Xn,8:Zn,9:Qn,10:$n,11:er,12:tr},j=void 0,ir={2:!0,3:!1,1:j,0:null,4:-0,5:1/0,6:-1/0,7:NaN},ar={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},or={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function M(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function sr(e){return M(2,j,e,j,j,j,j,j,j,j,j,j)}var cr=sr(2),lr=sr(3),ur=sr(1),dr=sr(0),fr=sr(4),pr=sr(5),mr=sr(6),hr=sr(7);function gr(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case` `:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return j}}function _r(e){let t=``,n=0,r;for(let i=0,a=e.length;iri(e),ai=class extends Error{constructor(e,t){super(ii(e,t)),this.cause=t}},oi=class extends ai{constructor(e){super(`parsing`,e)}},si=class extends ai{constructor(e){super(`deserialization`,e)}};function ci(e){return`Seroval Error (specific: ${e})`}var li=class extends Error{constructor(e){super(ci(1)),this.value=e}},ui=class extends Error{constructor(e){super(ci(2))}},di=class extends Error{constructor(e){super(ci(3))}},fi=class extends Error{constructor(e){super(ci(4))}},pi=class extends Error{constructor(e){super(ci(5)),this.value=e}},mi=class extends Error{constructor(e){super(ci(6))}},hi=class extends Error{constructor(e){super(ci(7))}},gi=class extends Error{constructor(e){super(ci(8))}},_i=class extends Error{constructor(e){super(ci(9))}},vi=class{constructor(e,t){this.value=e,this.replacement=t}},yi=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e};yi.toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString();var bi=()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r{for(i=0,a=e.length;i(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}};bi.toString();var xi=e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r};xi.toString();var Si=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l};Si.toString();var Ci=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e{}),t}var Fi=Si(Un,yi);function Ii(e){return Fi(e)}async function Li(e){try{return[1,await e]}catch(e){return[0,e]}}function Ri(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function zi(e,t){e.marked.add(t)}function Bi(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function Vi(e,t){let n=e.refs.get(t);return n==null?{type:0,value:Bi(e,t)}:(zi(e,n),{type:1,value:Pr(n)})}function N(e,t){let n=Vi(e,t);return n.type===1?n:Cr(t)?{type:2,value:Rr(n.value,t)}:n}function Hi(e,t){let n=N(e,t);if(n.type!==0)return n.value;if(t in nr)return Lr(n.value,t);throw new li(t)}function Ui(e,t){let n=Vi(e,ji[t]);return n.type===1?n.value:M(26,n.value,t,j,j,j,j,j,j,j,j,j)}function Wi(e){let t=Vi(e,ki);return t.type===1?t.value:M(27,t.value,j,j,j,j,j,j,Hi(e,Kn),j,j,j)}function Gi(e){let t=Vi(e,Ai);return t.type===1?t.value:M(29,t.value,j,j,j,j,j,[Ui(e,1),Hi(e,Un)],j,j,j,j)}function Ki(e,t,n,r){return M(n?11:10,e,j,j,j,r,j,j,j,j,Ar(t),j)}function qi(e,t,n,r){return M(8,t,j,j,j,j,{k:n,v:r},j,Ui(e,0),j,j,j)}function Ji(e,t,n){let r=new Uint8Array(n),i=``;for(let e=0,t=r.length;e{zi(this.base,t),ga(this,e,n).then(e=>{a.push(Zr(t,e))},e=>{i(e),o()})},throw:n=>{zi(this.base,t),ga(this,e,n).then(e=>{a.push(Qr(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{zi(this.base,t),ga(this,e,n).then(e=>{a.push($r(t,e)),r(a),o()},e=>{i(e),o()})}})}async function fa(e,t,n,r){return Xr(n,Ui(e.base,4),await new Promise(da.bind(e,t,n,r)))}async function pa(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n=e.base.depthLimit)throw new _i(e.base.depthLimit);switch(typeof n){case`boolean`:return n?cr:lr;case`undefined`:return ur;case`string`:return Mr(n);case`number`:return jr(n);case`bigint`:return Nr(n);case`object`:if(n){let r=N(e.base,n);return r.type===0?await ma(e,t+1,r.value,n):r.value}return dr;case`symbol`:return Hi(e.base,n);case`function`:return ha(e,t,n);default:throw new li(n)}}async function _a(e,t){try{return await ga(e,0,t)}catch(e){throw e instanceof oi?e:new oi(e)}}var va=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(va||{});function ya(e){return e}function ba(e,t){for(let n=0,r=t.length;n0)for(let a=0,o=n.v,s=i.length;aDa)throw new gi(t);return Ia(e,t.i,new RegExp(n,t.m))}throw new ui(t)}function Ja(e,t,n){let r=Ia(e,n.i,new Set);for(let i=0,a=n.a,o=a.length;iTa)throw new gi(t);return Ia(e,t.i,Ci(yr(t.s)))}function Za(e,t,n){let r=Sa(n.c),i=P(e,t,n.f),a=n.b??0;if(a<0||a>i.byteLength)throw new gi(n);return Ia(e,n.i,new r(i,a,n.l))}function Qa(e,t,n){let r=P(e,t,n.f),i=n.b??0;if(i<0||i>r.byteLength)throw new gi(n);return Ia(e,n.i,new DataView(r,i,n.l))}function $a(e,t,n,r){if(n.p){let i=Wa(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function eo(e,t,n){return $a(e,t,n,Ia(e,n.i,AggregateError([],yr(n.m))))}function to(e,t,n){let r=La(n,or,n.s);return $a(e,t,n,Ia(e,n.i,new r(yr(n.m))))}function no(e,t,n){let r=yi(),i=Ia(e,n.i,r.p),a=P(e,t,n.f);return n.s?r.s(a):r.f(a),i}function ro(e,t,n){return Ia(e,n.i,Object(P(e,t,n.f)))}function io(e,t,n){let r=e.base.plugins;if(r){let i=yr(n.c);for(let a=0,o=r.length;ae.base.depthLimit)throw new _i(e.base.depthLimit);switch(t+=1,n.t){case 2:return La(n,ir,n.s);case 0:return Number(n.s);case 1:return yr(String(n.s));case 3:if(String(n.s).length>Ea)throw new gi(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return Ra(e,n);case 9:return za(e,t,n);case 10:case 11:return Ga(e,t,n);case 5:return Ka(e,n);case 6:return qa(e,n);case 7:return Ja(e,t,n);case 8:return Ya(e,t,n);case 19:return Xa(e,n);case 16:case 15:return Za(e,t,n);case 20:return Qa(e,t,n);case 14:return eo(e,t,n);case 13:return to(e,t,n);case 12:return no(e,t,n);case 17:return La(n,rr,n.s);case 21:return ro(e,t,n);case 25:return io(e,t,n);case 22:return ao(e,n);case 23:return oo(e,t,n);case 24:return so(e,t,n);case 28:return co(e,t,n);case 30:return lo(e,t,n);case 31:return uo(e,t,n);case 32:return fo(e,t,n);case 33:return po(e,t,n);case 34:return mo(e,t,n);case 27:return ho(e,t,n);case 29:return go(e,t,n);case 35:return _o(e,t,n);default:throw new ui(n)}}function vo(e,t){try{return P(e,0,t)}catch(e){throw new si(e)}}var yo=(()=>T).toString();/=>/.test(yo);function F(e,t){return vo(ja({plugins:xa(t.plugins),refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function I(e,t={}){let n=Yi(1,{plugins:xa(t.plugins),disabledFeatures:t.disabledFeatures});return{t:await _a(n,e),f:n.base.features,m:Array.from(n.base.marked)}}function bo(e){return e}function xo(e){return ya({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n,r){return{v:n.parse(e.toSerializable(t))}},async async(t,n,r){return{v:await n.parse(e.toSerializable(t))}},stream(t,n,r){return{v:n.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,n,r){return e.fromSerializable(n.deserialize(t.v))}})}var So=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}},Co=globalThis.Buffer,wo=!!Co&&typeof Co.from==`function`;function To(e){if(e.length===0)return``;if(wo)return Co.from(e).toString(`base64`);let t=32768,n=[];for(let r=0;rnew ReadableStream({start(t){e.on({next(e){try{t.enqueue(Eo(e))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Ao=new TextEncoder,jo=e=>new ReadableStream({start(t){e.on({next(e){try{typeof e==`string`?t.enqueue(Ao.encode(e)):t.enqueue(Eo(e.$b64))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Mo=`(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i{try{for(;;){let{done:e,value:r}=await n.read();if(e){t.return(void 0);break}t.next(To(r))}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}function Fo(e){let t=Ni(),n=e.getReader(),r=new TextDecoder(`utf-8`,{fatal:!0});return(async()=>{try{for(;;){let{done:e,value:i}=await n.read();if(e){try{let e=r.decode();e.length>0&&t.next(e)}catch{}t.return(void 0);break}try{let e=r.decode(i,{stream:!0});e.length>0&&t.next(e)}catch{t.next({$b64:To(i)})}}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}var Io=ya({tag:`tss/RawStream`,extends:[ya({tag:`tss/RawStreamFactory`,test(e){return e===Do},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return Mo},deserialize(e,t,n){return Do}}),ya({tag:`tss/RawStreamFactoryText`,test(e){return e===Oo},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return No},deserialize(e,t,n){return Oo}})],test(e){return e instanceof So},parse:{sync(e,t,n){let r=e.hint===`text`?Oo:Do;return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(Ni())}},async async(e,t,n){let r=e.hint===`text`?Oo:Do,i=e.hint===`text`?Fo(e.stream):Po(e.stream);return{hint:await t.parse(e.hint),factory:await t.parse(r),stream:await t.parse(i)}},stream(e,t,n){let r=e.hint===`text`?Oo:Do,i=e.hint===`text`?Fo(e.stream):Po(e.stream);return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(i)}}},serialize(e,t,n){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t,n){let r=t.deserialize(e.stream);return t.deserialize(e.hint)===`text`?jo(r):ko(r)}});function Lo(e){return ya({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize(){throw Error(`RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.`)},deserialize(t,n,r){return e(typeof n?.deserialize==`function`?n.deserialize(t.streamId):t.streamId)}})}var Ro=ya({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),zo={},Bo=e=>new ReadableStream({start:t=>{e.on({next:e=>{try{t.enqueue(e)}catch{}},throw:e=>{t.error(e)},return:()=>{try{t.close()}catch{}}})}}),Vo=ya({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===zo},parse:{sync(){return zo},async async(){return await Promise.resolve(zo)},stream(){return zo}},serialize(){return Bo.toString()},deserialize(){return zo}});async function Ho(e,t){try{let n=await t.read();n.done?(e.return(n.value),t.releaseLock()):(e.next(n.value),await Ho(e,t))}catch(t){e.throw(t)}}function Uo(e){e.cancel().catch(()=>{}),e.releaseLock()}function Wo(e){let t=Ni(),n=e.getReader(),r=Uo.bind(null,n);return Ho(t,n).catch(r),[t,r]}var Go=[Ro,Io,ya({tag:`seroval/plugins/web/ReadableStream`,extends:[Vo],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(zo),stream:t.parse(Ni())}},async async(e,t){return{factory:await t.parse(zo),stream:await t.parse(Wo(e)[0])}},stream(e,t){let[n,r]=Wo(e);return t.addCleanup(r),{factory:t.parse(zo),stream:t.parse(n)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){return Bo(t.deserialize(e.stream))}})];function Ko(){return[...(C()?.serializationAdapters)?.map(xo)??[],...Go]}var qo=new TextDecoder,Jo=new Uint8Array,Yo=16777216,Xo=33554432,Zo=1024,Qo=1e5;function $o(e){let t=new Map,n=new Map,r=new Set,i=!1,a=null,o=0,s,c=new ReadableStream({start(e){s=e},cancel(){i=!0;try{a?.cancel()}catch{}t.forEach(e=>{try{e.error(Error(`Framed response cancelled`))}catch{}}),t.clear(),n.clear(),r.clear()}});function l(e){let i=n.get(e);if(i)return i;if(r.has(e))return new ReadableStream({start(e){e.close()}});if(n.size>=Zo)throw Error(`Too many raw streams in framed response (max ${Zo})`);let a=new ReadableStream({start(n){t.set(e,n)},cancel(){r.add(e),t.delete(e),n.delete(e)}});return n.set(e,a),a}function u(e){return l(e),t.get(e)}return(async()=>{let n=e.getReader();a=n;let c=[],l=0;function d(){if(l<9)return null;let e=c[0];if(e.length>=9)return{type:e[0],streamId:(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,length:(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0};let t=new Uint8Array(9),n=0,r=9;for(let e=0;e0;e++){let i=c[e],a=Math.min(i.length,r);t.set(i.subarray(0,a),n),n+=a,r-=a}return{type:t[0],streamId:(t[1]<<24|t[2]<<16|t[3]<<8|t[4])>>>0,length:(t[5]<<24|t[6]<<16|t[7]<<8|t[8])>>>0}}function f(e){if(e===0)return Jo;let t=c[0];if(t&&t.length>=e){let n=t.subarray(0,e);return t.length===e?c.shift():c[0]=t.subarray(e),l-=e,n}let n=new Uint8Array(e),r=0,i=e;for(;i>0&&c.length>0;){let e=c[0];if(!e)break;let t=Math.min(e.length,i);n.set(e.subarray(0,t),r),r+=t,i-=t,t===e.length?c.shift():c[0]=e.subarray(t)}return l-=e,n}try{for(;;){let{done:e,value:a}=await n.read();if(i||e)break;if(a){if(l+a.length>Xo)throw Error(`Framed response buffer exceeded ${Xo} bytes`);for(c.push(a),l+=a.length;;){let e=d();if(!e)break;let{type:n,streamId:i,length:a}=e;if(n!==b.JSON&&n!==b.CHUNK&&n!==b.END&&n!==b.ERROR)throw Error(`Unknown frame type: ${n}`);if(n===b.JSON){if(i!==0)throw Error(`Invalid JSON frame streamId (expected 0)`)}else if(i===0)throw Error(`Invalid raw frame streamId (expected non-zero)`);if(a>Yo)throw Error(`Frame payload too large: ${a} bytes (max ${Yo})`);let c=9+a;if(lQo)throw Error(`Too many frames in framed response (max ${Qo})`);f(9);let p=f(a);switch(n){case b.JSON:try{s.enqueue(qo.decode(p))}catch{}break;case b.CHUNK:{let e=u(i);e&&e.enqueue(p);break}case b.END:{let e=u(i);if(r.add(i),e){try{e.close()}catch{}t.delete(i)}break}case b.ERROR:{let e=u(i);if(r.add(i),e){let n=qo.decode(p);e.error(Error(n)),t.delete(i)}break}}}}}if(l!==0)throw Error(`Incomplete frame at end of framed response`);try{s.close()}catch{}t.forEach(e=>{try{e.close()}catch{}}),t.clear()}catch(e){try{s.error(e)}catch{}t.forEach(t=>{try{t.error(e)}catch{}}),t.clear()}finally{try{n.releaseLock()}catch{}a=null}})(),{getOrCreateStream:l,jsonChunks:c}}var es=null;async function ts(e){e.length>0&&await Promise.allSettled(e)}var ns=Object.prototype.hasOwnProperty;function rs(e){for(let t in e)if(ns.call(e,t))return!0;return!1}async function is(e,t,n){es||=Ko();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData?`formData`:`payload`,o=r.headers?new Headers(r.headers):new Headers;if(o.set(`x-tsr-serverFn`,`true`),a===`payload`&&o.set(`accept`,`${y}, application/x-ndjson, application/json`),r.method===`GET`){if(a===`formData`)throw Error(`FormData is not supported with GET requests`);let t=await as(r);if(t!==void 0){let n=Ct({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;if(r.method===`POST`){let e=await ss(r);e?.contentType&&o.set(`content-type`,e.contentType),s=e?.body}return await cs(async()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function as(e){let t=!1,n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&rs(e.context)&&(t=!0,n.context=e.context),t)return os(n)}async function os(e){return JSON.stringify(await Promise.resolve(I(e,{plugins:es})))}async function ss(e){if(e.data instanceof FormData){let t;return e.context&&rs(e.context)&&(t=await os(e.context)),t!==void 0&&e.data.set(_,t),{body:e.data}}let t=await as(e);if(t)return{body:t,contentType:`application/json`}}async function cs(e){let t;try{t=await e()}catch(e){if(e instanceof Response)t=e;else throw console.log(e),e}if(t.headers.get(`x-tss-raw`)===`true`)return t;let n=t.headers.get(`content-type`);if(n||Ce(),t.headers.get(`x-tss-serialized`)){let e;if(n.includes(`application/x-tss-framed`)){if(S(n),!t.body)throw Error(`No response body for framed response`);let{getOrCreateStream:r,jsonChunks:i}=$o(t.body),a=[Lo(r),...es||[]],o=new Map;e=await ls({jsonStream:i,onMessage:e=>F(e,{refs:o,plugins:a}),onError(e,t){console.error(e,t)}})}else if(n.includes(`application/json`)){let n=await t.json(),r=[];try{e=F(n,{plugins:es})}finally{}await ts(r)}if(e||Ce(),e instanceof Error)throw e;return e}if(n.includes(`application/json`)){let e=await t.json(),n=Nt(e);if(n)throw n;if(ct(e))throw e;return e}if(!t.ok)throw Error(await t.text());return t}async function ls({jsonStream:e,onMessage:t,onError:n}){let r=e.getReader(),{value:i,done:a}=await r.read();if(a||!i)throw Error(`Stream ended before first object`);let o=JSON.parse(i),s=!1,c=(async()=>{try{for(;;){let{value:e,done:i}=await r.read();if(i)break;if(e)try{let n=[];try{t(JSON.parse(e))}finally{}await ts(n)}catch(t){n?.(`Invalid JSON: ${e}`,t)}}}catch(e){s||n?.(`Stream processing error:`,e)}})(),l,u=[];try{l=t(o)}catch(e){throw s=!0,r.cancel().catch(()=>{}),e}return await ts(u),Promise.resolve(l).catch(()=>{s=!0,r.cancel().catch(()=>{})}),c.finally(()=>{try{r.releaseLock()}catch{}}),l}function us(e){let t=`/_serverFn/`+e;return Object.assign((...e)=>{let n=C()?.serverFns?.fetch;return is(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[v]:!0})}var ds=bo({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(v in e)?!1:!!e[v],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>us(e)});function fs(e){return e.replaceAll(`\0`,`/`).replaceAll(`�`,`/`)}function ps(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function ms(e){window.$_TSR||Ce();let t=e.options.serializationAdapters;if(t?.length){let e=new Map;t.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,window.$_TSR.router||Ce();let n=window.$_TSR.router;n.matches.forEach(e=>{e.i=fs(e.i)}),n.lastMatchId&&=fs(n.lastMatchId);let{manifest:r,dehydratedData:i,lastMatchId:a}=n;e.ssr={manifest:r};let o=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:o},await e.options.hydrate?.(i);let s=e.matchRoutes(e.stores.location.get()),c=Promise.all(s.map(t=>e.loadRouteChunk(e.looseRoutesById[t.routeId])));function l(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=fe();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function u(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let d;s.forEach(e=>{let t=n.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,u(e);return}ps(e,t),u(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&d===void 0&&(d=e.index,l(e))}),e.stores.setMatches(s);let f=e.stores.matches.get(),p=e.stores.location.get();await Promise.all(f.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=f[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:p,navigate:t=>e.navigate({...t,_fromLocation:p}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:s,routeId:n.id};t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:f,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),o=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=o}catch(e){if(ct(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let m=s[s.length-1].id!==a;if(!s.some(e=>e.ssr===!1)&&!m)return s.forEach(e=>{e._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),c;let h=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(m){let t=s[1];t||Ce(),l(t),t._displayPending=!0,t._nonReactive.displayPendingPromise=h,h.then(()=>{e.batch(()=>{e.stores.status.get()===`pending`&&(e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(t.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return c}var L=c(u(),1),hs=L.use,gs=typeof window<`u`?L.useLayoutEffect:L.useEffect;function _s(e){let t=L.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function vs(e,t,n={},r={}){L.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function ys(e){let t=L.useRef(null);return L.useImperativeHandle(e,()=>t.current,[]),t}var bs=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),xs=o(((e,t)=>{t.exports=bs()})),R=xs();function Ss({promise:e}){if(hs)return hs(e);let t=Mn(e);if(t[jn].status===`pending`)throw t;if(t[jn].status===`error`)throw t[jn].error;return t[jn].data}function Cs(e){let t=(0,R.jsx)(ws,{...e});return e.fallback?(0,R.jsx)(L.Suspense,{fallback:e.fallback,children:t}):t}function ws(e){let t=Ss(e);return e.children(t)}function Ts(e){let t=e.errorComponent??Ds;return(0,R.jsx)(Es,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?L.createElement(t,{error:n,reset:r}):e.children})}var Es=class extends L.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Ds({error:e}){let[t,n]=L.useState(!1);return(0,R.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,R.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,R.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,R.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,R.jsx)(`div`,{children:(0,R.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,R.jsx)(`code`,{children:e.message}):null})}):null]})}function Os({children:e,fallback:t=null}){return ks()?(0,R.jsx)(L.Fragment,{children:e}):(0,R.jsx)(L.Fragment,{children:t})}function ks(){return L.useSyncExternalStore(As,()=>!0,()=>!1)}function As(){return()=>{}}var js=L.createContext(null);function Ms(e){return L.useContext(js)}var Ns=L.createContext(void 0),Ps=L.createContext(void 0),Fs=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Fs||{});function Is({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ls(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Rs=[],zs=0,{link:Bs,unlink:Vs,propagate:Hs,checkDirty:Us,shallowPropagate:Ws}=Is({update(e){return e._update()},notify(e){Rs[Ks++]=e,e.flags&=~Fs.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Fs.Mutable|Fs.Dirty,Xs(e))}}),Gs=0,Ks=0,qs,Js=0;function Ys(e){try{++Js,e()}finally{--Js||Zs()}}function Xs(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Vs(n,e)}function Zs(){if(!(Js>0)){for(;Gs{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=qs,o=t?.compare??Object.is;if(n)qs=i,++zs,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Fs.Mutable|Fs.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{qs=a,n&&(i.flags&=~Fs.RecursedCheck),Xs(i)}}};return n?(i.flags=Fs.Mutable|Fs.Dirty,i.get=function(){let e=i.flags;if(e&Fs.Dirty||e&Fs.Pending&&Us(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ws(e)}}else e&Fs.Pending&&(i.flags=e&~Fs.Pending);return qs!==void 0&&Bs(i,qs,zs),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Hs(e),Ws(e),Zs())}},i}function $s(e){let t=()=>{let t=qs;qs=n,++zs,n.depsTail=void 0,n.flags=Fs.Watching|Fs.RecursedCheck;try{return e()}finally{qs=t,n.flags&=~Fs.RecursedCheck,Xs(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Fs.Watching|Fs.RecursedCheck,notify(){let e=this.flags;e&Fs.Dirty||e&Fs.Pending&&Us(this.deps,this)?t():this.flags=Fs.Watching},stop(){this.flags=Fs.None,this.depsTail=void 0,Xs(this)}};return t(),n}var ec=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),tc=o(((e,t)=>{t.exports=ec()})),nc=o((e=>{var t=u(),n=tc();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),rc=o(((e,t)=>{t.exports=nc()}))();function ic(e,t){return e===t}function ac(e,t,n=ic){let r=(0,L.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,L.useCallback)(()=>e?.get(),[e]);return(0,rc.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var oc={get(){},subscribe(){return{unsubscribe(){}}}};function sc(e,t){let n=L.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ce(n.current,i):i}}function cc(e){let t=Ms(),n=L.useContext(e.from?Ps:Ns),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=sc(e,t),a=ac(r??oc,e=>e?i(e):oc);if(a!==oc)return a;(e.shouldThrow??!0)&&Ce()}function lc(e){return cc({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function uc(e){let{select:t,...n}=e;return cc({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function dc(e){return cc({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function fc(e){return cc({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function pc(e){let t=Ms();return L.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function mc(e){return cc({...e,select:t=>e.select?e.select(t.context):t.context})}var hc=m();function gc(e,t){let n=Ms(),r=ys(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:ee,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:te,ignoreBlocker:re,params:ie,search:ae,hash:oe,state:se,mask:ce,reloadDocument:le,unsafeRelative:ue,from:E,_fromLocation:D,...fe}=e,pe=ks(),O=L.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),k=ac(n.stores.location,e=>e,(e,t)=>e.href===t.href),A=L.useMemo(()=>{let e={_fromLocation:k,...O};return n.buildLocation(e)},[n,k,O]),me=A.maskedLocation?A.maskedLocation.publicHref:A.publicHref,he=A.maskedLocation?A.maskedLocation.external:A.external,_e=L.useMemo(()=>Tc(me,he,n.history,v),[v,he,me,n.history]),ve=L.useMemo(()=>{if(_e?.external)return ge(_e.href,n.protocolAllowlist)?void 0:_e.href;if(!Ec(s)&&typeof s==`string`&&s.indexOf(`:`)!==-1)try{return new URL(s),ge(s,n.protocolAllowlist)?void 0:s}catch{}},[s,_e,n.protocolAllowlist]),ye=L.useMemo(()=>{if(ve)return!1;if(o?.exact){if(!tt(k.pathname,A.pathname,n.basepath))return!1}else{let e=et(k.pathname,n.basepath),t=et(A.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!de(k.search,A.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:!o?.includeHash||pe&&k.hash===A.hash},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,k,ve,pe,A.hash,A.pathname,A.search,n.basepath]),be=ye?ne(i,{})??vc:_c,xe=ye?_c:ne(a,{})??_c,Se=[b,be.className,xe.className].filter(Boolean).join(` `),Ce=(y||be.style||xe.style)&&{...y,...be.style,...xe.style},[we,Te]=L.useState(!1),Ee=L.useRef(!1),De=e.reloadDocument||ve?!1:c??n.options.defaultPreload,Oe=l??n.options.defaultPreloadDelay??0,ke=L.useCallback(()=>{n.preloadRoute({...O,_builtLocation:A}).catch(e=>{console.warn(e),console.warn(Nn)})},[n,O,A]);vs(r,L.useCallback(e=>{e?.isIntersecting&&ke()},[ke]),Cc,{disabled:!!v||De!==`viewport`}),L.useEffect(()=>{Ee.current||!v&&De===`render`&&(ke(),Ee.current=!0)},[v,ke,De]);let Ae=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Oc(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,hc.flushSync)(()=>{Te(!0)});let t=n.subscribe(`onResolved`,()=>{t(),Te(!1)});n.navigate({...O,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:re})}};if(ve)return{...fe,ref:r,href:ve,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...ee&&{onBlur:ee},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...te&&{onTouchStart:te}};let je=e=>{if(v||De!==`intent`)return;if(!Oe){ke();return}let t=e.currentTarget;if(Sc.has(t))return;let n=setTimeout(()=>{Sc.delete(t),ke()},Oe);Sc.set(t,n)},Me=e=>{v||De!==`intent`||ke()},Ne=e=>{if(v||!De||!Oe)return;let t=e.currentTarget,n=Sc.get(t);n&&(clearTimeout(n),Sc.delete(t))};return{...fe,...be,...xe,href:_e?.href,ref:r,onClick:wc([x,Ae]),onBlur:wc([ee,Ne]),onFocus:wc([S,je]),onMouseEnter:wc([C,je]),onMouseLeave:wc([w,Ne]),onTouchStart:wc([te,Me]),disabled:!!v,target:_,...Ce&&{style:Ce},...Se&&{className:Se},...v&&yc,...ye&&bc,...pe&&we&&xc}}var _c={},vc={className:`active`},yc={role:`link`,"aria-disabled":!0},bc={"data-status":`active`,"aria-current":`page`},xc={"data-transitioning":`transitioning`},Sc=new WeakMap,Cc={rootMargin:`100px`},wc=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Tc(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ec(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Dc=L.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=gc(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return L.createElement(`a`,t,o)}return L.createElement(n,a,o)});function Oc(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var kc=class extends Bn{constructor(e){super(e),this.useMatch=e=>cc({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>mc({...e,from:this.id}),this.useSearch=e=>fc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>dc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>uc({...e,from:this.id}),this.useLoaderData=e=>lc({...e,from:this.id}),this.useNavigate=()=>pc({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Dc,{ref:t,from:this.fullPath,...e}))}};function Ac(e){return new kc(e)}function jc(){return e=>Nc(e)}var Mc=class extends Vn{constructor(e){super(e),this.useMatch=e=>cc({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>mc({...e,from:this.id}),this.useSearch=e=>fc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>dc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>uc({...e,from:this.id}),this.useLoaderData=e=>lc({...e,from:this.id}),this.useNavigate=()=>pc({from:this.fullPath}),this.Link=L.forwardRef((e,t)=>(0,R.jsx)(Dc,{ref:t,from:this.fullPath,...e}))}};function Nc(e){return new Mc(e)}function Pc(e){return new Fc(e,{silent:!0}).createRoute}var Fc=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Ac(e);return t.isRoot=!1,t},this.silent=t?.silent}};function Ic(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,pe(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(hs)hs(o());else throw o();return L.createElement(r,e)};return s.preload=o,s}function Lc(e){let t=Ms(),n=`not-found-${ac(t.stores.location,e=>e.pathname)}-${ac(t.stores.status,e=>e)}`;return(0,R.jsx)(Ts,{getResetKey:()=>n,onCatch:(t,n)=>{if(ct(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ct(t))return e.fallback?.(t);throw t},children:e.children})}function Rc(){return(0,R.jsx)(`p`,{children:`Not Found`})}function zc(e){return(0,R.jsx)(R.Fragment,{children:e.children})}function Bc(e,t,n){return t.options.notFoundComponent?(0,R.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,R.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,R.jsx)(Rc,{})}var Vc=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Hc=(e,t)=>e[0]===t[0]&&e[1]===t[1],Uc=L.memo(function({matchId:e}){let t=Ms(),n=t.stores.matchStores.get(e);n||Ce();let r=ac(t.stores.loadedAt,e=>e),i=ac(n,e=>e,Vc);return(0,R.jsx)(Wc,{router:t,matchId:e,resetKey:r,matchState:L.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Wc({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,R.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?L.Suspense:zc,f=s?Ts:zc,p=l?Lc:zc;return(0,R.jsxs)(i.isRoot?i.options.shellComponent??zc:zc,{children:[(0,R.jsx)(Ns.Provider,{value:t,children:(0,R.jsx)(d,{fallback:o,children:(0,R.jsx)(f,{getResetKey:()=>n,errorComponent:s||Ds,onCatch:(e,t)=>{if(ct(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,R.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return L.createElement(l,e)},children:u||r._displayPending?(0,R.jsx)(Os,{fallback:o,children:(0,R.jsx)(Kc,{matchId:t})}):(0,R.jsx)(Kc,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gc,{}),(e.options.scrollRestoration,null)]}):null]})}function Gc(){let e=Ms(),t=L.useRef();return gs(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...bn(e.stores.location.get(),r??n)}),t.current=n},[ac(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Kc=L.memo(function({matchId:e}){let t=Ms(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Ce();let i=ac(r,e=>e),a=i.routeId,o=t.routesById[a],s=L.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=L.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,R.jsx)(e,{},s):(0,R.jsx)(qc,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=fe();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return ct(i.error)||Ce(),Bc(t,o,i.error);if(i.status===`redirected`)throw Mt(i.error)||Ce(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),qc=L.memo(function(){let e=Ms(),t=L.useContext(Ns),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=ac(a,e=>[e?.routeId,e?.globalNotFound??!1],Hc),i=ac(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,R.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Ce(),Bc(e,a,void 0);if(!i)return null;let s=(0,R.jsx)(Uc,{matchId:i});return n===`__root__`?(0,R.jsx)(L.Suspense,{fallback:o,children:s}):s});function Jc(){let e=Ms(),t=L.useRef({router:e,mounted:!1}),[n,r]=L.useState(!1),i=ac(e.stores.isLoading,e=>e),a=ac(e.stores.hasPending,e=>e),o=_s(i),s=i||n||a,c=_s(s),l=i||a,u=_s(l);return e.startTransition=e=>{r(!0),L.startTransition(()=>{e(),r(!1)})},L.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qe(e.latestLocation.publicHref)!==Qe(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),gs(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),gs(()=>{o&&!i&&e.emit({type:`onLoad`,...bn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),gs(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...bn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),gs(()=>{if(c&&!s){let t=bn(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Ys(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Yc(){let e=Ms(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,R.jsx)(t,{}):null,r=(0,R.jsxs)(typeof document<`u`&&e.ssr?zc:L.Suspense,{fallback:n,children:[(0,R.jsx)(Jc,{}),(0,R.jsx)(Xc,{})]});return e.options.InnerWrap?(0,R.jsx)(e.options.InnerWrap,{children:r}):r}function Xc(){let e=Ms(),t=ac(e.stores.firstId,e=>e),n=ac(e.stores.loadedAt,e=>e),r=t?(0,R.jsx)(Uc,{matchId:t}):null;return(0,R.jsx)(Ns.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,R.jsx)(Ts,{getResetKey:()=>n,errorComponent:Ds,onCatch:void 0,children:r})})}var Zc=e=>({createMutableStore:Qs,createReadonlyStore:Qs,batch:Ys}),Qc=e=>new $c(e),$c=class extends xn{constructor(e){super(e,Zc)}};function el({router:e,children:t,...n}){ae(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,R.jsx)(js.Provider,{value:e,children:t});return e.options.Wrap?(0,R.jsx)(e.options.Wrap,{children:r}):r}function tl({router:e,...t}){return(0,R.jsx)(el,{router:e,...t,children:(0,R.jsx)(Yc,{})})}function nl(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function rl(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e;switch(e.tag){case`title`:return(0,R.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,R.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,R.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,R.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,R.jsx)(il,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function il({attrs:e,children:t,preventScriptHoist:n}){Ms();let r=ks(),i=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(L.useEffect(()=>{if(!i){if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();for(let e of document.querySelectorAll(`script[src]`))if(e.src===t)return;let n=document.createElement(`script`);return nl(n,e),document.head.appendChild(n),()=>n.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.querySelectorAll(`script:not([src])`)){if(!(e instanceof HTMLScriptElement))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,nl(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,i]),i&&typeof t==`string`)return(0,R.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return(0,R.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,R.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var al=e=>{let t=Ms(),n=t.options.ssr?.nonce,r=ac(t.stores.matches,e=>e.map(e=>e.meta).filter(e=>e!==void 0),de),i=L.useMemo(()=>{let e=[],t={},i;for(let a=r.length-1;a>=0;a--){let o=r[a];for(let r=o.length-1;r>=0;r--){let a=o[r];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:ye(t)})}catch{}else{let r=a.name??a.property;if(r){if(t[r])continue;t[r]=!0}e.push({tag:`meta`,attrs:{...a,nonce:n}})}}}return i&&e.push(i),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=ac(t.stores.matches,e=>e.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),de),o=ac(t.stores.matches,r=>{let i=t.ssr?.manifest,a=[];return i?(r.forEach(t=>{i.routes[t.routeId]?.css?.forEach(t=>{let r=zn(t);a.push({tag:`link`,attrs:{rel:`stylesheet`,...r,crossOrigin:Pn(e,`stylesheet`)??r.crossOrigin,suppressHydrationWarning:!0,nonce:n}})})}),i.inlineStyle&&a.push({tag:`style`,attrs:{...i.inlineStyle.attrs,nonce:n},children:i.inlineStyle.children,inlineCss:!0}),a):a},de),s=ac(t.stores.matches,r=>{let i=[],a=t.ssr?.manifest;return a&&r.forEach(t=>{a.routes[t.routeId]?.preloads?.forEach(t=>{i.push({tag:`link`,attrs:{...In(a,t,e),nonce:n}})})}),i},de),c=ac(t.stores.matches,e=>e.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),de),l=ac(t.stores.matches,e=>e.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),de),u=[];return Rn(u,i),u.push(...s),Rn(u,a),u.push(...o),Rn(u,c),Rn(u,l),u};function ol(e){let t=al(e.assetCrossOrigin),n=Ms().options.ssr?.nonce;return(0,R.jsx)(R.Fragment,{children:t.map(e=>(0,L.createElement)(rl,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var sl=()=>{let e=Ms(),t=e.options.ssr?.nonce,n=n=>{let r=[],i=e.ssr?.manifest;if(!i)return[];for(let e of n){let n=i.routes[e.routeId]?.scripts;if(n)for(let e of n)r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children,...typeof e.attrs?.src==`string`?{preventScriptHoist:!0}:{}})}return r},r=e=>e.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e})),i=ac(e.stores.matches,n,de);return cl(e,ac(e.stores.matches,r,de),i)};function cl(e,t,n){let r=[...t,...n];return(0,R.jsx)(R.Fragment,{children:r.map((e,t)=>(0,L.createElement)(rl,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}var ll=(e,t)=>{let n={type:`request`,...t||e},r=e=>ll({},Object.assign(n,{validator:e,inputValidator:e}));return{options:n,middleware:e=>ll({},Object.assign(n,{middleware:e})),validator:r,inputValidator:r,client:e=>ll({},Object.assign(n,{client:e})),server:e=>ll({},Object.assign(n,{server:e}))}};function ul(e,t){for(let n=0,r=t.length;n({getOptions:async()=>{let t=await e();if(t.serializationAdapters){let e=new Set;ul(e,t.serializationAdapters),t.serializationAdapters=Array.from(e)}return t},createMiddleware:ll}),fl=Symbol.for(`@supabase/supabase-js.traceContextExtractor`);function pl(){return globalThis[fl]}function ml(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie?(...t)=>e(...t):(...e)=>fetch(...e),_l=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},vl=class extends _l{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},yl=class extends _l{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},bl=class extends _l{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},xl;(function(e){e.Any=`any`,e.ApNortheast1=`ap-northeast-1`,e.ApNortheast2=`ap-northeast-2`,e.ApSouth1=`ap-south-1`,e.ApSoutheast1=`ap-southeast-1`,e.ApSoutheast2=`ap-southeast-2`,e.CaCentral1=`ca-central-1`,e.EuCentral1=`eu-central-1`,e.EuWest1=`eu-west-1`,e.EuWest2=`eu-west-2`,e.EuWest3=`eu-west-3`,e.SaEast1=`sa-east-1`,e.UsEast1=`us-east-1`,e.UsWest1=`us-west-1`,e.UsWest2=`us-west-2`})(xl||={});var Sl=class{constructor(e,{headers:t={},customFetch:n,region:r=xl.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=gl(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return hl(this,arguments,void 0,function*(e,t={}){var n;let r,i,a;try{let{headers:n,method:o,body:s,signal:c,timeout:l}=t,u={},{region:d}=t;d||=this.region;let f=new URL(`${this.url}/${e}`);d&&d!==`any`&&(u[`x-region`]=d,f.searchParams.set(`forceFunctionRegion`,d));let p,m=!!n&&Object.keys(n).some(e=>e.toLowerCase()===`content-type`);s&&!m?typeof Blob<`u`&&s instanceof Blob||s instanceof ArrayBuffer?(u[`Content-Type`]=`application/octet-stream`,p=s):typeof s==`string`?(u[`Content-Type`]=`text/plain`,p=s):typeof FormData<`u`&&s instanceof FormData?p=s:(u[`Content-Type`]=`application/json`,p=JSON.stringify(s)):p=s&&typeof s!=`string`&&!(typeof Blob<`u`&&s instanceof Blob)&&!(s instanceof ArrayBuffer)&&!(typeof FormData<`u`&&s instanceof FormData)?JSON.stringify(s):s;let h=c;l&&(i=new AbortController,r=setTimeout(()=>i.abort(),l),c?(h=i.signal,a=()=>i.abort(),c.addEventListener(`abort`,a)):h=i.signal);let g=yield this.fetch(f.toString(),{method:o||`POST`,headers:Object.assign(Object.assign(Object.assign({},u),this.headers),n),body:p,signal:h}).catch(e=>{throw new vl(e)}),_=g.headers.get(`x-relay-error`);if(_&&_===`true`)throw new yl(g);if(!g.ok)throw new bl(g);let v=(g.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim().toLowerCase(),y;return y=v===`application/json`?yield g.json():v===`application/octet-stream`||v===`application/pdf`?yield g.blob():v===`text/event-stream`?g:v===`multipart/form-data`?yield g.formData():yield g.text(),{data:y,error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof bl||e instanceof yl?e.context:void 0}}finally{r&&clearTimeout(r),a&&((n=t.signal)==null||n.removeEventListener(`abort`,a))}})}},Cl=3,wl=e=>Math.min(1e3*2**e,3e4),Tl=[520,503],El=[`GET`,`HEAD`,`OPTIONS`],Dl=class extends Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Ol(e){"@babel/helpers - typeof";return Ol=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ol(e)}function kl(e,t){if(Ol(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ol(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Al(e){var t=kl(e,`string`);return Ol(t)==`symbol`?t:t+``}function jl(e,t,n){return(t=Al(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nl(e){for(var t=1;t{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function Fl(e,t,n,r){return!(!r||n>=Cl||!El.includes(e)||!Tl.includes(t))}var Il=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,this.fetch=e.fetch?e.fetch:fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!El.includes(n.method))throw t;if(n.retryEnabled&&e{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new Dl({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);if(s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r))if(r.length>1){if(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`,t.shouldThrowOnError)throw new Dl(Nl(Nl({},n),{},{hint:n.hint??``}))}else r=r.length===1?r[0]:null}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new Dl(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},Ll=class extends Il{throwOnError(){return super.throwOnError()}select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set(`Accept`,`application/vnd.pgrst.object+json`),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),this}rollback(){return this.headers.append(`Prefer`,`tx=rollback`),this}returns(){return this}maxAffected(e){return this.headers.append(`Prefer`,`handling=strict`),this.headers.append(`Prefer`,`max-affected=${e}`),this}},Rl=RegExp(`[,()]`),zl=class extends Ll{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(`,`)}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(`,`)}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(`,`)}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(`,`)}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Rl.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&Rl.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Bl=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new zl({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new zl({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new zl({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new zl({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new zl({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Vl=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;this.fetch=i!==void 0&&i>0?(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Nl(Nl({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Nl(Nl({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new Bl(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new zl({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Hl=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)return{type:`cloudflare`,error:`Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.`,workaround:`Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.`};if(typeof globalThis<`u`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.includes(`Vercel-Edge`))return{type:`unsupported`,error:`Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.`,workaround:`Use serverless functions or a different deployment target for WebSocket functionality.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node)return{type:`unsupported`,error:`Node.js detected but native WebSocket not found.`,workaround:`Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.`}}return{type:`unsupported`,error:`Unknown JavaScript runtime without WebSocket support.`,workaround:`Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.`}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{return this.detectEnvironment().type===`native`}catch{return!1}}},Ul=`realtime-js/2.112.4`,Wl=`1.0.0`,Gl=`2.0.0`,Kl=Gl,z=1e4,B={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},V={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},H={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},U=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=`broadcast`,this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=new TextEncoder,i=r.encode(e.topic),a=r.encode(e.ref??``),o=r.encode(e.join_ref??``),s=r.encode(e.payload.event),c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=r.encode(Object.keys(c).length===0?``:JSON.stringify(c));if(o.length>255)throw Error(`joinRef length ${o.length} exceeds maximum of 255`);if(a.length>255)throw Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`topic length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`userEvent length ${s.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+o.length+a.length+i.length+s.length+l.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),f=new DataView(d),p=new Uint8Array(d),m=0;f.setUint8(m++,this.KINDS.userBroadcastPush),f.setUint8(m++,o.length),f.setUint8(m++,a.length),f.setUint8(m++,i.length),f.setUint8(m++,s.length),f.setUint8(m++,l.length),f.setUint8(m++,t),p.set(o,m),m+=o.length,p.set(a,m),m+=a.length,p.set(i,m),m+=i.length,p.set(s,m),m+=s.length,p.set(l,m),m+=l.length;var h=new Uint8Array(d.byteLength+n.byteLength);return h.set(new Uint8Array(d),0),h.set(new Uint8Array(n),d.byteLength),h.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},W;(function(e){e.abstime=`abstime`,e.bool=`bool`,e.date=`date`,e.daterange=`daterange`,e.float4=`float4`,e.float8=`float8`,e.int2=`int2`,e.int4=`int4`,e.int4range=`int4range`,e.int8=`int8`,e.int8range=`int8range`,e.json=`json`,e.jsonb=`jsonb`,e.money=`money`,e.numeric=`numeric`,e.oid=`oid`,e.reltime=`reltime`,e.text=`text`,e.time=`time`,e.timestamp=`timestamp`,e.timestamptz=`timestamptz`,e.timetz=`timetz`,e.tsrange=`tsrange`,e.tstzrange=`tstzrange`})(W||={});var ql=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Jl(i,e,t,r),n),{}):{}},Jl=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Yl(i,a):Xl(a)},Yl=(e,t)=>{if(e.charAt(0)===`_`)return eu(t,e.slice(1,e.length));switch(e){case W.bool:return Zl(t);case W.float4:case W.float8:case W.int2:case W.int4:case W.int8:case W.numeric:case W.oid:return Ql(t);case W.json:case W.jsonb:return $l(t);case W.timestamp:return tu(t);case W.abstime:case W.date:case W.daterange:case W.int4range:case W.int8range:case W.money:case W.reltime:case W.text:case W.time:case W.timestamptz:case W.timetz:case W.tsrange:case W.tstzrange:return Xl(t);default:return Xl(t)}},Xl=e=>e,Zl=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},Ql=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},$l=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},eu=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>Yl(t,e))}return e},tu=e=>typeof e==`string`?e.replace(` `,`T`):e,nu=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,`http`),t.pathname=t.pathname.replace(/\/+$/,``).replace(/\/socket\/websocket$/i,``).replace(/\/socket$/i,``).replace(/\/websocket$/i,``),t.pathname===``||t.pathname===`/`?t.pathname=`/api/broadcast`:t.pathname+=`/api/broadcast`,t.href},ru=e=>typeof e==`function`?e:function(){return e},iu=typeof self<`u`?self:null,au=typeof window<`u`?window:null,ou=iu||au||globalThis,su=`2.0.0`,cu=1e4,lu=1e3,uu=100,G={connecting:0,open:1,closing:2,closed:3},du={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},fu={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},pu={longpoll:`longpoll`,websocket:`websocket`},mu={complete:4},hu=`base64url.bearer.phx.`,gu=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived(`timeout`)||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},_u=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},vu=class{constructor(e,t,n){this.state=du.closed,this.topic=e,this.params=ru(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new gu(this,fu.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new _u(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=du.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=du.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=du.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=du.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new gu(this,fu.leave,ru({}),this.timeout).send(),this.state=du.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(fu.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=du.closed,this.bindings=[]}onClose(e){this.on(fu.close,e)}onError(e){return this.on(fu.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>n.event!==e||t!==void 0&&t!==n.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new gu(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=du.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(fu.close,`leave`)},n=new gu(this,fu.leave,ru({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=du.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;ec.abort(),i),s.signal=c.signal),ou.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===mu.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},bu=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;ethis.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+pu.websocket),`$1/`+pu.longpoll)}endpointURL(){return yu.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=G.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===G.open||this.readyState===G.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=G.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=bu(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let n=t+uu,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(` `),()=>this.onerror(`timeout`),t=>{!t||t.status!==200?(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,`internal server error`,!1)):n0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=G.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=yu.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},Su=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let a=Object.create(null),o=Object.create(null);return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){e=this.toNullProtoObj(e);let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},Cu={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=new TextEncoder,s=o.encode(t),c=o.encode(n),l=o.encode(i),u=o.encode(r);this.assertFieldSize(s.byteLength,`join_ref`),this.assertFieldSize(c.byteLength,`ref`),this.assertFieldSize(l.byteLength,`topic`),this.assertFieldSize(u.byteLength,`event`);let d=this.META_LENGTH+s.byteLength+c.byteLength+l.byteLength+u.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),m=new DataView(f),h=0;m.setUint8(h++,this.KINDS.push),m.setUint8(h++,s.byteLength),m.setUint8(h++,c.byteLength),m.setUint8(h++,l.byteLength),m.setUint8(h++,u.byteLength),p.set(s,h),h+=s.byteLength,p.set(c,h),h+=c.byteLength,p.set(l,h),h+=l.byteLength,p.set(u,h),h+=u.byteLength;var g=new Uint8Array(f.byteLength+a.byteLength);return g.set(p,0),g.set(new Uint8Array(a),f.byteLength),g.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:fu.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},wu=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||cu,this.transport=t.transport||ou.WebSocket||xu,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=ou&&ou.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Cu.encode.bind(Cu),this.defaultDecoder=Cu.decode.bind(Cu),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===xu?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;au&&au.addEventListener&&(au.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),au.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),au.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ru(t.params||{}),this.endPoint=`${e}/${pu.websocket}`,this.vsn=t.vsn||su,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new _u(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&ru(t.authToken)}getLongPollTransport(){return xu}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=yu.appendParams(yu.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=ru(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==xu?this.connectWithFallback(xu,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case xu:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${hu}${btoa(this.authToken()).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a,o=this.transportName(e),s=t=>{this.log(`transport`,`falling back to ${o}...`,t),this.off([i,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return s(`memorized`);this.fallbackTimer=setTimeout(s,t),a=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),s(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(s,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),lu,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===G.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(fu.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case G.connecting:return`connecting`;case G.open:return`open`;case G.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new vu(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return this.ref=e===this.ref?0:e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},Tu=class e{constructor(t,n){let r=Ou(n);this.presence=new Su(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=Du(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Eu(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:ku(t),newPresences:Eu(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:ku(t),leftPresences:Eu(n)}}};function Eu(e){return e.metas.map(e=>{let t=Object.getOwnPropertyDescriptors(e),n=Object.defineProperties({},t);return n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n})}function Du(e){return JSON.parse(JSON.stringify(e))}function Ou(e){return e?.events&&{events:e.events}}function ku(e){return e?.metas?Eu(e):[]}var Au;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(Au||={});var ju=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Tu(this.channel.channelAdapter,t)}};function Mu(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var Nu=class{constructor(e,t,n){let r=Pu(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===B.joined}isJoined(){return this.state===B.joined}isJoining(){return this.state===B.joining}isClosed(){return this.state===B.closed}isLeaving(){return this.state===B.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Pu(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Fu=/[,()"\\]/,Iu=e=>Fu.test(e)||e!==e.trim(),Lu=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,Ru=e=>{let t=e===null?`null`:String(e);return Iu(t)?Lu(t):t},zu=e=>e===null?`null`:String(e),Bu=(e,t)=>{if(e===`in`){let e=Array.isArray(t)?t:[t];if(e.length===0)throw Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(e)).map(e=>Ru(e)).join(`,`)})`}return e===`is`?`is.${zu(t)}`:`${e}.${Ru(t)}`},Vu=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${Bu(t,n)}`),this}eq(e,t){return this.add(e,`eq`,t)}neq(e,t){return this.add(e,`neq`,t)}gt(e,t){return this.add(e,`gt`,t)}gte(e,t){return this.add(e,`gte`,t)}lt(e,t){return this.add(e,`lt`,t)}lte(e,t){return this.add(e,`lte`,t)}in(e,t){return this.add(e,`in`,t)}like(e,t){return this.add(e,`like`,t)}ilike(e,t){return this.add(e,`ilike`,t)}match(e,t){return this.add(e,`match`,t)}imatch(e,t){return this.add(e,`imatch`,t)}is(e,t){return this.add(e,`is`,t)}isDistinct(e,t){return this.add(e,`isdistinct`,t)}not(e,t,n){return this.add(e,t,n,!0)}build(){return this.filters.join(`,`)}toString(){return this.build()}},Hu;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(Hu||={});var Uu;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(Uu||={});var Wu;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Wu||={});var Gu=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new Nu(this.socket.socketAdapter,e,this.params),this.presence=new ju(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=nu(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[Uu.PRESENCE]&&this.bindings[Uu.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Wu.CHANNEL_ERROR,Mu(t))}),this._onClose(()=>e?.(Wu.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Wu.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=B.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Wu.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Wu.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(t,n,r){let i=t.toLocaleLowerCase(),a=n?.filter;if((a instanceof Vu||typeof a==`object`&&a&&typeof a.build==`function`)&&(n=Object.assign(Object.assign({},n),{filter:a.build()})),i===Uu.POSTGRES_CHANGES&&this.bindings[i]?.find(t=>e.isSamePostgresFilter(t.filter,n)))return this.socket.log(`error`,`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,n),this;let o=this.channelAdapter.on(t,r),s={type:i,filter:n,callback:r,ref:o};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=V;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}static isSamePostgresFilter(t,n){let r=(t?.select)?.join()??void 0,i=(n?.select)?.join()??void 0;return t?.event===n?.event&&e.isFilterValueEqual(t?.schema,n?.schema)&&e.isFilterValueEqual(t?.table,n?.table)&&e.isFilterValueEqual(t?.filter,n?.filter)&&r===i}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=ql(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=ql(e.columns,e.old_record)),t}},Ku=class{constructor(e,t){this.socket=new wu(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}hasLogger(){return this.socket.hasLogger()}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==H.connecting}isDisconnecting(){return this.socket.connectionState()==H.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},qu={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Ju=[1e3,2e3,5e3,1e4],Yu=1e4;function Xu(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function K(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Xu()}var Zu=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`,Qu=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={},this.ref=0,this.serializer=new U,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new Ku(e,n),this.httpEndpoint=nu(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||H.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new Gu(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){let t=++this._authGeneration,n=this._performAuth(e,t);t===this._authGeneration&&(this._authPromise=n);try{await n}finally{this._authPromise===n&&(this._authPromise=null)}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e,t){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),n=this.accessTokenValue}else n=this.accessTokenValue;t===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:r&&(this._manuallySetToken=!0),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(e=>{let t={access_token:n,version:Ul};e.updateJoinPayload(t),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(V.access_token,{access_token:n})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t!==`disconnected`&&(t==`sent`&&this._setAuthSafely(),e&&e(t,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([Zu],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??z,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??qu.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??qu.HEARTBEAT_INTERVAL),t.transport=e?.transport??Hl.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??K(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>Ju[e-1]||Yu);let n,r,i=e?.vsn??Kl;switch(i){case Wl:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Gl:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}},$u=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function ed(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function td(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function nd(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=ed(e.baseUrl,r,i),c=await td(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new $u(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function rd(e){return e.join(``)}var id=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:rd(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${rd(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${rd(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${rd(e.namespace)}`}),!0}catch(e){if(e instanceof $u&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof $u&&e.status===409)return;throw e}}};function ad(e){return e.join(``)}var od=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${ad(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof $u&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof $u&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},sd=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=nd({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new id(this.client,t),this.tableOps=new od(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function cd(e){"@babel/helpers - typeof";return cd=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cd(e)}function ld(e,t){if(cd(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cd(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ud(e){var t=ld(e,`string`);return cd(t)==`symbol`?t:t+``}function dd(e,t,n){return(t=ud(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;te?(...t)=>e(...t):(...e)=>fetch(...e),bd=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},xd=e=>{if(Array.isArray(e))return e.map(e=>xd(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=xd(n)}),t},Sd=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Cd=e=>e.split(`/`).map(encodeURIComponent).join(`/`),wd=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},J=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new hd(wd(e),i,n,r,e?.code))}).catch(()=>{let e=i+``;t(new hd(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new gd(wd(e),e,r))},Td=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return q(q({},i),n);if(bd(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=_d(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),q(q({},i),n)};async function Ed(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,Td(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>J(e,c,r,o))})}function Dd(e=`storage`){return{get:async(t,n,r,i)=>Ed(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Ed(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Ed(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Ed(t,`HEAD`,n,q(q({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Ed(t,`DELETE`,n,i,a,r,e)}}var{get:Od,post:kd,put:Ad,head:jd,remove:Md}=Dd(`storage`),Nd=Dd(`vectors`),Pd=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=vd(t),this.fetch=yd(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=_d(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(md(e))return{data:null,error:e};throw e}}},Fd=Symbol.toStringTag,Id=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Fd]=`StreamDownloadBuilder`,this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(md(t))return{data:null,error:t};throw t}}},Ld=Symbol.toStringTag,Rd=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Ld]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Id(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(md(t))return{data:null,error:t};throw t}}},zd={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Bd={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Vd=class extends Pd{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=q(q({},Bd),r),s=q(q({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=_d(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?Ad:kd)(i.fetch,`${i.url}/object/${u}`,a,q({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=q(q({},Bd),r),o=q(q({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=_d(o,e,t);return{path:a,fullPath:(await Ad(i.fetch,s.toString(),e,q({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=q({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await kd(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new pd(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await kd(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await kd(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await kd(r.fetch,`${r.url}/object/sign/${i}`,q({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await kd(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>q(q({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new Rd(()=>Od(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>xd(await Od(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await jd(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(md(e)){let t=e instanceof hd?e.status:e instanceof gd?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Md(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=Cd(r._getFinalPath(e)),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await Md(r.fetch,`${r.url}/cdn/${i}${o?`?${o}`:``}`,{},{headers:r.headers},n)})}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=t?.sortBy?q(q({},zd.sortBy),t.sortBy):zd.sortBy,a=q(q(q({},zd),t),{},{sortBy:i,prefix:e||``});return await kd(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=q({},e);return await kd(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},Hd={"X-Client-Info":`storage-js/2.112.4`},Ud=class extends Pd{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=q(q({},Hd),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Od(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Od(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await kd(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Ad(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await kd(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Md(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=new URLSearchParams;t?.transformations&&i.set(`transformations`,`true`);let a=i.toString();return await Md(r.fetch,`${r.url}/cdn/${Cd(e)}${a?`?${a}`:``}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?`?`+new URLSearchParams(t).toString():``}},Wd=class extends Pd{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=q(q({},Hd),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await kd(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Od(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Md(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Sd(e))throw new pd(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new sd({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},Gd=class extends Pd{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=q(q({},Hd),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Nd.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Nd.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Kd=class extends Pd{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=q(q({},Hd),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},qd=class extends Pd{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=q(q({},Hd),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Nd.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Jd=class extends qd{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Yd(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Yd=class extends Gd{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Xd(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Xd=class extends Kd{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,q(q({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Zd=class extends Ud{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Vd(this.url,this.headers,e,this.fetch)}get vectors(){return new Jd(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Wd(this.url+`/iceberg`,this.headers,this.fetch)}},Qd=`2.112.4`,$d=3e4,ef=3*$d,tf=2*$d,nf=`http://localhost:9999`,rf=`supabase.auth.token`,af={"X-Client-Info":`gotrue-js/${Qd}`},of=`X-Supabase-Api-Version`,sf={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},cf=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,lf=`sb_flow_id`,uf=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function Y(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var df=class extends uf{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function ff(e){return Y(e)&&e.name===`AuthApiError`}var pf=class extends uf{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},mf=class extends uf{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},hf=class extends mf{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function gf(e){return Y(e)&&e.name===`AuthSessionMissingError`}var _f=class extends mf{constructor(){super(`Auth session or user missing`,`AuthInvalidTokenResponseError`,500,void 0)}},vf=class extends mf{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},yf=class extends mf{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function bf(e){return Y(e)&&e.name===`AuthImplicitGrantRedirectError`}var xf=class extends mf{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},Sf=class extends mf{constructor(){super(`PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.`,`AuthPKCECodeVerifierMissingError`,400,`pkce_code_verifier_not_found`)}},Cf=class extends mf{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function wf(e){return Y(e)&&e.name===`AuthRetryableFetchError`}var Tf=class extends mf{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function Ef(e){return Y(e)&&e.name===`AuthRefreshDiscardedError`}var Df=class extends mf{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},Of=class extends mf{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},kf=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),Af=` \r=`.split(``),jf=(()=>{let e=Array(128);for(let t=0;t=6;)n(kf[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(kf[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Nf(e,t,n){let r=jf[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function Pf(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Lf(e,r,n)};for(let t=0;t>6),t(128|e&63);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function If(e,t){for(let n=0;n55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}Ff(r,t)}}function Lf(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function Rf(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;tt.push(e)),new Uint8Array(t)}function Bf(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Mf(e,n,r)),Mf(null,n,r),t.join(``)}function Vf(e){return Math.round(Date.now()/1e3)+e}function Hf(){return Symbol(`auth-callback`)}var Uf=()=>typeof window<`u`&&typeof document<`u`,Wf={tested:!1,writable:!1},Gf=()=>{if(!Uf())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(Wf.tested)return Wf.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Wf.tested=!0,Wf.writable=!0}catch{Wf.tested=!0,Wf.writable=!1}return Wf.writable};function Kf(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var qf=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Jf=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,Yf=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Xf=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Zf=async(e,t)=>{await e.removeItem(t)},Qf=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};Qf.promiseConstructor=Promise;function $f(e){let t=e.split(`.`);if(t.length!==3)throw new Of(`Invalid JWT structure`);for(let e=0;e{setTimeout(()=>t(null),e)})}function tp(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function np(e){return(`0`+e.toString(16)).substr(-2)}function rp(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,np).join(``)}async function ip(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function ap(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await ip(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var op=/^[a-zA-Z0-9_-]{8,64}$/;function sp(e){return typeof e==`string`&&op.test(e)?e:null}function cp(){if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,np).join(``)}let e=``;for(let t=0;t<32;t++)e+=Math.floor(Math.random()*16).toString(16);return e}var lp=(e,t)=>`${e}-flow-${t}-code-verifier`,up=e=>`${e}-flows-code-verifier`;async function dp(e,t){let n=await Xf(e,up(t));return Array.isArray(n)?n.filter(e=>sp(e)!==null):[]}async function fp(e,t,n,r,i){await Yf(e,lp(t,n),r);let a=(await dp(e,t)).filter(e=>e!==n);for(a.push(n);a.length>5;){let n=a.shift();await Zf(e,lp(t,n)),i?.(n)}await Yf(e,up(t),a),await Yf(e,`${t}-code-verifier`,r)}async function pp(e,t,n){if(n){let r=await Xf(e,lp(t,n));return{verifier:typeof r==`string`?r:null,flowId:n}}let r=await Xf(e,`${t}-code-verifier`);return{verifier:typeof r==`string`?r:null,flowId:null}}async function mp(e,t,n){let r=`${t}-code-verifier`;if(!n){await Zf(e,r);return}let i=lp(t,n),a=await Xf(e,i);await Zf(e,i);let o=await dp(e,t),s=o.filter(e=>e!==n);s.length!==o.length&&(s.length>0?await Yf(e,up(t),s):await Zf(e,up(t))),a!=null&&a===await Xf(e,r)&&await Zf(e,r)}async function hp(e,t){let n=await dp(e,t);for(let r of n)await Zf(e,lp(t,r));await Zf(e,up(t)),await Zf(e,`${t}-code-verifier`)}function gp(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n),a=r.indexOf(`?`);if(a!==-1){let e=r.slice(0,a),t=r.slice(a+1).split(`&`).filter(e=>e!==``&&e!==`sb_flow_id`&&!e.startsWith(`sb_flow_id=`));r=t.length>0?`${e}?${t.join(`&`)}`:e}let o=r.includes(`?`)?`&`:`?`;return`${r}${o}${lf}=${encodeURIComponent(t)}${i}`}async function _p(e,t,n=!1,r){let i=rp(),a=i;n&&(a+=`/recovery`);let o=cp();await fp(e,t,o,a,r);let s=await ap(i);return[s,i===s?`plain`:`s256`,o]}var vp=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function yp(e){let t=e.headers.get(of);if(!t||!t.match(vp))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function bp(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function xp(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var Sp=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Cp(e){if(!Sp.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function wp(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Tp(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Ep(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`string`&&(console.warn(`Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.`),t.value=!0),Reflect.get(e,n,r)}})}function Dp(e){return JSON.parse(JSON.stringify(e))}var Op=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},kp=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Ap(e){if(!Jf(e))throw new Cf(Op(e),0);let t;try{t=await e.json()}catch(t){throw kp.includes(e.status)?new Cf(e.statusText||`HTTP ${e.status}`,e.status):new pf(Op(t),t)}if(kp.includes(e.status))throw new Cf(Op(t),e.status);let n,r=yp(e);if(r&&r.getTime()>=sf[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new Df(Op(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new Df(Op(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new hf;throw new df(Op(t),e.status||500,n)}var jp=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function X(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[of]=sf[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await Mp(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function Mp(e,t,n,r,i,a){let o=jp(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw new Cf(Op(e),0)}if(s.ok||await Ap(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Ap(e)}}function Np(e){let t=null;zp(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Vf(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Pp(e){let t=Np(e);return!t.error&&e.weak_password&&typeof e.weak_password==`object`&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message==`string`&&e.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function Fp(e){return{data:{user:e.user??e},error:null}}function Ip(e){return{data:e,error:null}}function Lp(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=ml(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function Rp(e){return e}function zp(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Bp=[`global`,`local`,`others`],Vp=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=qf(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=Bp[0]){if(Bp.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Bp.join(`, `)}`);try{return await X(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Y(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await X(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Fp})}catch(e){if(Y(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=ml(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await X(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:Lp,redirectTo:t?.redirectTo})}catch(e){if(Y(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await X(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Fp})}catch(e){if(Y(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await X(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Rp});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(Y(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){Cp(e);try{return await X(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Fp})}catch(e){if(Y(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){Cp(e);try{return await X(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Fp})}catch(e){if(Y(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){Cp(e);try{return await X(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Fp})}catch(e){if(Y(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){Cp(e.userId);try{let{data:t,error:n}=await X(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _deleteFactor(e){Cp(e.userId),Cp(e.id);try{return{data:await X(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await X(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Rp});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(Y(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await X(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await X(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await X(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await X(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await X(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await X(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(Y(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await X(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await X(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await X(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await X(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){wp(this.experimental),Cp(e.userId);try{return await X(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Y(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){wp(this.experimental),Cp(e.userId),Cp(e.passkeyId);try{return await X(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Y(e))return{data:null,error:e};throw e}}};function Hp(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Gf()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var Up=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Wp(){if(typeof globalThis!=`object`)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<`u`&&(self.globalThis=self)}}function Gp(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Kp(e){return parseInt(e,16)}function qp(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Jp(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` `))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=Gp(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var Yp=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},Xp=class extends Yp{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Zp({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Yp({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Yp({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Yp({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Yp({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Yp({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Yp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Yp({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Yp({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!im(t))return new Yp({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Yp({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Yp({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Yp({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new Yp({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function Qp({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Yp({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Yp({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!im(t))return new Yp({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Yp({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Yp({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new Yp({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var $p=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function em(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=ml(e,[`challenge`,`user`,`excludeCredentials`]),a=Rf(t).buffer,o=Object.assign(Object.assign({},n),{id:Rf(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e0){a.allowCredentials=Array(n.length);for(let e=0;etypeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];r[e]=t(n)?um(n,a):um(a)}else r[e]=a}return r}function dm(e,t){return um(cm,e,t||{})}function fm(e,t){return um(lm,e,t||{})}var pm=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??$p.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await om({publicKey:dm(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=fm(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await sm(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return Y(e)?{data:null,error:e}:{data:null,error:new pf(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new uf(`rpId is required for WebAuthn authentication`)};try{if(!am())return{data:null,error:new pf(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return Y(e)?{data:null,error:e}:{data:null,error:new pf(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new uf(`rpId is required for WebAuthn registration`)};try{if(!am())return{data:null,error:new pf(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return Y(e)?{data:null,error:e}:{data:null,error:new pf(`Unexpected error in register`,e)}}}};Wp();var mm={url:nf,storageKey:rf,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:af,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},hm={},gm=!1,_m=class e{get jwks(){return hm[this.storageKey]?.jwks??{keys:[]}}set jwks(e){hm[this.storageKey]=Object.assign(Object.assign({},hm[this.storageKey]),{jwks:e})}get jwks_cached_at(){return hm[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){hm[this.storageKey]=Object.assign(Object.assign({},hm[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},mm),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&Uf()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new Vp({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=qf(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock,gm||(gm=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new pm(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:Gf()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Hp(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Hp(this.memoryStorage)),Uf()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e),(e.data.event===`TOKEN_REFRESHED`||e.data.event===`SIGNED_IN`)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Qd}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock==null?await this._initialize():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))();let e=await this.initializePromise,t=this._pendingInitNotifications??[];this._pendingInitNotifications=null;for(let e of t)await this._notifyAllSubscribers(e.event,e.session,e.broadcast);return e}async _initialize(){try{let e={},t=`none`;if(Uf()&&(e=Kf(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),Uf()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),bf(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return Y(e)?this._returnResult({error:e}):this._returnResult({error:new pf(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await X(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Np});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){let t=null;try{let n;if(`email`in e){let{email:r,password:i,options:a}=e,o=null,s=null;this.flowType===`pkce`&&([o,s,t]=await this._getCodeChallengeAndMethod()),n=await X(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(a?.emailRedirectTo,t),body:{email:r,password:i,data:a?.data??{},gotrue_meta_security:{captcha_token:a?.captchaToken},code_challenge:o,code_challenge_method:s},xform:Np})}else if(`phone`in e){let{phone:t,password:r,options:i}=e;n=await X(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Np})}else throw new vf(`You must provide either an email or phone number and a password`);let{data:r,error:i}=n;if(i||!r)return await mp(this.storage,this.storageKey,t),this._returnResult({data:{user:null,session:null},error:i});let a=r.session,o=r.user;return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(await mp(this.storage,this.storageKey,t),Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await X(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Pp})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await X(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Pp})}else throw new vf(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new _f;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e,t){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e,t):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e,t))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Uf()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=Gp(l[0]),d=o?.signInWithEthereum?.chainId;d||=Kp(await s.request({method:`eth_chainId`})),t=Jp({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[qp(t),u]})}try{let{data:r,error:i}=await X(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Np});if(i)throw i;if(!r||!r.session||!r.user){let e=new _f;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Uf()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` `);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await X(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:Bf(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Np});if(i)throw i;if(!r||!r.session||!r.user){let e=new _f;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e,t){let n=t?.flowId!=null,r=n?sp(t?.flowId):Uf()?sp(Kf(window.location.href)[lf]):null;n&&!r&&this._debug(`#_exchangeCodeForSession()`,`provided flowId is not a valid flow id`,t?.flowId);let{verifier:i,flowId:a}=n&&!r?{verifier:null,flowId:null}:await pp(this.storage,this.storageKey,r),[o,s]=(i??``).split(`/`);try{if(!o&&this.flowType===`pkce`)throw new Sf;let{data:t,error:n}=await X(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:o},xform:Np});if(await mp(this.storage,this.storageKey,a),n)throw n;if(!t||!t.session||!t.user){let e=new _f;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(s===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:s??null}),error:n})}catch(e){if(await mp(this.storage,this.storageKey,a),Y(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await X(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Np});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new _f;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){let t=null;try{if(`email`in e){let{email:n,options:r}=e,i=null,a=null;this.flowType===`pkce`&&([i,a,t]=await this._getCodeChallengeAndMethod());let{error:o}=await X(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:n,data:r?.data??{},create_user:r?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:r?.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:this._maybeAppendFlowIdToRedirect(r?.emailRedirectTo,t)});return this._returnResult({data:{user:null,session:null},error:o})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await X(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new vf(`You must provide either an email or phone number.`)}catch(e){if(await mp(this.storage,this.storageKey,t),Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await X(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Np});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){let t=null;try{let n=null,r=null;this.flowType===`pkce`&&([n,r,t]=await this._getCodeChallengeAndMethod());let i=await X(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:this._maybeAppendFlowIdToRedirect(e.options?.redirectTo,t)}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:r}),headers:this.headers,xform:Ip});return i.data?.url&&Uf()&&!e.options?.skipBrowserRedirect&&window.location.assign(i.data.url),this._returnResult(i)}catch(e){if(await mp(this.storage,this.storageKey,t),Y(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,this.lock==null?await this._reauthenticate():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new hf;let{error:r}=await X(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){let t=null;try{let n=`${this.url}/resend`;if(`email`in e){let{email:r,type:i,options:a}=e,o=null,s=null;this.flowType===`pkce`&&([o,s,t]=await this._getCodeChallengeAndMethod());let{error:c}=await X(this.fetch,`POST`,n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:a?.captchaToken},code_challenge:o,code_challenge_method:s},redirectTo:this._maybeAppendFlowIdToRedirect(a?.emailRedirectTo,t)});return c&&await mp(this.storage,this.storageKey,t),this._returnResult({data:{user:null,session:null},error:c})}if(`phone`in e){let{phone:t,type:r,options:i}=e,{data:a,error:o}=await X(this.fetch,`POST`,n,{headers:this.headers,body:{phone:t,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new vf(`You must provide either an email or phone number and a type`)}catch(e){if(await mp(this.storage,this.storageKey,t),Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,this.lock==null?await this._useSession(async e=>e):await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lock!=null&&!this.lockAcquired&&this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await Xf(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not valid`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()Date.now()){let t=await Xf(this.storage,this.storageKey);if(t&&t.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return t=this.lock==null?await this._getUser():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await X(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:Fp}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new hf}:await X(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:Fp})})}catch(e){if(Y(e))return gf(e)&&await this._removeSession(),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){let n=null;try{return await this._useSession(async r=>{let{data:i,error:a}=r;if(a)throw a;if(!i.session)throw new hf;let o=i.session,s=null,c=null;this.flowType===`pkce`&&e.email!=null&&([s,c,n]=await this._getCodeChallengeAndMethod());let{data:l,error:u}=await X(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(t?.emailRedirectTo,n),body:Object.assign(Object.assign({},e),{code_challenge:s,code_challenge_method:c}),jwt:o.access_token,xform:Fp});if(u)throw u;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers(`USER_UPDATED`,o),this._returnResult({data:{user:o.user},error:null})})}catch(e){if(await mp(this.storage,this.storageKey,n),Y(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,this.lock==null?await this._setSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new hf;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=$f(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(Y(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,this.lock==null?await this._refreshSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new hf;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!Uf())throw new yf(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new yf(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new xf(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new yf(`Not a valid implicit grant flow url.`)}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new xf(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code,{flowId:e[lf]});if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),r.searchParams.delete(lf),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new yf(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(Y(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){if(!e.code)return!1;let t=sp(e[lf]);return t&&await Xf(this.storage,lp(this.storageKey,t))?!0:!!await Xf(this.storage,`${this.storageKey}-code-verifier`)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let n=async()=>{await this._removeSession()},{data:r,error:i}=t;if(i&&!gf(i))return this._returnResult({error:i});let a=r.session?.access_token;if(a){let{error:t}=await this.admin.signOut(a,e);if(t&&!(ff(t)&&(t.status===404||t.status===401||t.status===403)||gf(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=Hf(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,this.lock==null?await this._emitInitialSession(t):await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),gf(t)||wf(t)||ff(t)&&(t.code===`refresh_token_not_found`||t.code===`refresh_token_already_used`||t.code===`session_expired`)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null,i=null;this.flowType===`pkce`&&([n,r,i]=await this._getCodeChallengeAndMethod(!0));try{return await X(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(t.redirectTo,i)})}catch(e){if(await mp(this.storage,this.storageKey,i),Y(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){let t=null;try{let{data:n,error:r}=await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;let{url:a,flowId:o}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return t=o,await X(this.fetch,`GET`,a,{headers:this.headers,jwt:r.session?.access_token??void 0})});if(r)throw r;return Uf()&&!e.options?.skipBrowserRedirect&&window.location.assign(n?.url),this._returnResult({data:{provider:e.provider,url:n?.url,flowId:t},error:null})}catch(n){if(Y(n))return this._returnResult({data:{provider:e.provider,url:null,flowId:t},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await X(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Np});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new _f}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await mp(this.storage,this.storageKey,null),Y(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await X(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken()`;this._debug(t,`begin`);try{let n=Date.now();return await tp(async n=>(n>0&&await ep(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await X(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Np})),(e,t)=>{let r=200*2**e;return t&&wf(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),Y(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let{url:n,flowId:r}=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),Uf()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n,flowId:r},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await Xf(this.storage,this.storageKey);if(t&&this.userStorage){let e=await Xf(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await Yf(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??Tp()}else if(t&&!t.user&&!t.user){let e=await Xf(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await Zf(this.storage,this.storageKey+`-user`),await Yf(this.storage,this.storageKey,t)):t.user=Tp()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not valid`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now(){});let t=await Xf(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new hf;let a=await Xf(this.storage,this.storageKey);if(t!==null&&(a===null||a.refresh_token!==t.refresh_token)){this._debug(r,`commit guard: storage changed since refresh started, discarding rotated tokens`,{startedWith:`present`,nowHolds:a?`replaced`:`cleared`});let e={data:null,error:new Tf};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(n.session),this._sessionRemovalEpoch!==o){this._debug(r,`commit guard (post-save): _removeSession ran during _saveSession, undoing write`),await Zf(this.storage,this.storageKey),this.userStorage&&await Zf(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new Tf};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers(`TOKEN_REFRESHED`,n.session);let s={data:n.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(s),s}catch(i){if(this._debug(r,`error`,i),Y(i)){let n={data:null,error:i};if(!wf(i)){let e=await Xf(this.storage,this.storageKey);e?.expires_at&&e.expires_at*1e3>Date.now()?this._debug(r,`proactive refresh failed, access token still valid — preserving session`):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:n,expiresAt:Date.now()+tf},(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:e,session:t,broadcast:n});return}let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;ethis._autoRefreshTokenTick(),$d);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)==null||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(`#_autoRefreshTokenTick()`,`begin`),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/$d);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${$d}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof Up)this._debug(`auto refresh token tick lock not available`);else throw e}return}if(this.refreshingDeferred!==null){this._debug(`#_autoRefreshTokenTick()`,`refresh already in flight, skipping`);return}try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/$d);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${$d}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!Uf()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=n?.redirectTo,i=null,a=null,o=null;this.flowType===`pkce`&&([i,a,o]=await this._getCodeChallengeAndMethod(),r=this._maybeAppendFlowIdToRedirect(r,o));let s=[`provider=${encodeURIComponent(t)}`];if(r&&s.push(`redirect_to=${encodeURIComponent(r)}`),n?.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),i!=null&&a!=null){let e=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(e.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);s.push(e.toString())}return n?.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),{url:`${e}?${s.join(`&`)}`,flowId:o}}_maybeAppendFlowIdToRedirect(e,t){return!e||!t||!this.experimental.appendPkceFlowIdToRedirects?e??void 0:gp(e,t)}async _getCodeChallengeAndMethod(e=!1){return _p(this.storage,this.storageKey,e,e=>this._debug(`#_getCodeChallengeAndMethod()`,`evicted oldest pending PKCE verifier slot`,e))}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await X(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await X(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?nm(e.webauthn.credential_response):rm(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await X(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await X(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:em(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:tm(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=$f(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=$f(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await X(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new hf})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new hf});let a=await X(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Uf()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new hf});let a=await X(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Uf()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await X(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new hf})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await X(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new hf})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await X(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=$f(n);if(!t?.allowExpired)try{bp(i.exp)}catch(e){throw new Of(e instanceof Error?e.message:`JWT validation failed`)}let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=xp(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,zf(`${o}.${s}`)))throw new Of(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){wp(this.experimental);try{if(!am())return this._returnResult({data:null,error:new pf(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await sm({publicKey:tm(t.options),signal:e?.options?.signal??$p.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new pf(`WebAuthn ceremony failed`,null)});let a=rm(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){wp(this.experimental);try{if(!am())return this._returnResult({data:null,error:new pf(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await om({publicKey:em(t.options),signal:e?.options?.signal??$p.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new pf(`WebAuthn ceremony failed`,null)});let a=nm(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){wp(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new hf});let{data:r,error:i}=await X(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){wp(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new hf});let{data:i,error:a}=await X(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){wp(this.experimental);try{let{data:t,error:n}=await X(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){wp(this.experimental);try{let{data:t,error:n}=await X(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Np});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){wp(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new hf});let{data:r,error:i}=await X(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){wp(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new hf});let{data:i,error:a}=await X(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){wp(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new hf});let{error:i}=await X(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(Y(e))return this._returnResult({data:null,error:e});throw e}}};_m.nextInstanceID={};var vm=_m,ym=`2.112.4`,bm=``,xm;if(typeof Deno<`u`)bm=`deno`,xm=Deno.version?.deno;else if(typeof document<`u`)bm=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)bm=`react-native`;else{var Sm;bm=`node`;let e=globalThis.process;xm=e==null||(Sm=e.version)==null?void 0:Sm.replace(/^v/,``)}var Cm=[`runtime=${bm}`];xm&&Cm.push(`runtime-version=${xm}`);var wm={headers:{"X-Client-Info":`supabase-js/${ym}; ${Cm.join(`; `)}`}},Tm={schema:`public`},Em={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Dm={},Om={enabled:!1,respectSamplingDecision:!0};function km(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function Am(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(jm(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function jm(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function Mm(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function Nm(e){"@babel/helpers - typeof";return Nm=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Nm(e)}function Pm(e,t){if(Nm(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Nm(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fm(e){var t=Pm(e,`string`);return Nm(t)==`symbol`?t:t+``}function Im(e,t,n){return(t=Fm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rm(e){for(var t=1;te?(...t)=>e(...t):(...e)=>fetch(...e),Bm=()=>Headers,Vm=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),Hm=`sb_temp_`,Um=new Set,Wm=e=>{if(!e.startsWith(`sb_`)||Vm(e)||e.startsWith(Hm))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;Um.has(t)||(Um.add(t),console.warn(`@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.`))},Gm=(e,t,n,r,i,a)=>{let o=zm(r),s=Bm(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?Mm(t):null,d=!(a?.omitApiKeyAsBearer&&Vm(e));return async(t,r)=>{let i=await n(),a=new s(r?.headers);if(a.has(`apikey`)||a.set(`apikey`,e),!a.has(`Authorization`)){let t=i??(d?e:null);t&&a.set(`Authorization`,`Bearer ${t}`)}if(u){let e=Jm(t,u,l);e&&(e.traceparent&&!a.has(`traceparent`)&&a.set(`traceparent`,e.traceparent),e.tracestate&&!a.has(`tracestate`)&&a.set(`tracestate`,e.tracestate),e.baggage&&!a.has(`baggage`)&&a.set(`baggage`,e.baggage))}return o(t,Rm(Rm({},r),{},{headers:a}))}},Km=!1,qm=!1;function Jm(e,t,n){let r=pl();if(!r)return Km||(Km=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!Am(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let i=r();if(!i||!i.traceparent){var a;if(i!=null&&(a=i.carrierKeys)!=null&&a.length&&!qm){qm=!0;let e=i.carrierKeys.includes(`sentry-trace`)?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.":` Configure your tracing SDK to emit W3C trace context on outgoing requests.`;console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${i.carrierKeys.join(`, `)}] and no W3C traceparent header, so trace headers will not be attached.`+e)}return null}if(n){let e=km(i.traceparent);if(e&&!e.isSampled)return{traceparent:i.traceparent}}return i}function Ym(e){return typeof e==`boolean`?{enabled:e}:e}function Xm(e){return e.endsWith(`/`)?e:e+`/`}function Zm(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Ym(e.tracePropagation),d=Ym(t.tracePropagation),f={db:Rm(Rm({},o),n),auth:Rm(Rm({},s),r),realtime:Rm(Rm({},c),i),storage:{},global:Rm(Rm(Rm({},l),a),{},{headers:Rm(Rm({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Qm(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Xm(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var $m=class extends vm{constructor(e){super(e)}},eh=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=Qm(e);if(!t)throw Error(`supabaseKey is required.`);Wm(t),this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:Tm,realtime:Dm,auth:Rm(Rm({},Em),{},{storageKey:i}),global:wm,tracePropagation:Om},o=Zm(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Gm(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=Gm(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(Rm({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new Vl(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit,retry:o.db.retry}),this.storage=new Zd(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new Sl(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??null}async _getAccessToken(){var e=this;return await e._getSessionToken()??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $m({url:this.authUrl.href,headers:Rm(Rm({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new Qu(this.realtimeUrl.href,Rm(Rm({},e),{},{params:Rm(Rm({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`||e===`INITIAL_SESSION`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},th=(e,t,n)=>new eh(e,t,n);function nh(){if(typeof window<`u`||globalThis.Deno!==void 0)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=20:!1}nh()&&console.warn(`⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715`);function rh(){if(typeof window>`u`)return;let e=location.hostname,t=[`lovableproject.com`,`lovableproject-dev.com`,`lovable.app`,`gpt-eng.com`,`gptengineer.run`].some(t=>e===t||e.endsWith(`.`+t))?e.match(RegExp(`^(?:id-preview(?:-[a-z0-9]+)?|project)--([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})(?:-dev)?(?=\\.|$)`,`i`))?.[1]??e.match(RegExp(`^([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})(?=[.-])`,`i`))?.[1]:void 0,n=window.parent&&window.parent!==window;if(!t||!n)return localStorage;let r=e.endsWith(`.lovableproject-dev.com`)||e.endsWith(`.gpt-eng.com`),i=r?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,a=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:``),o=a&&i.test(a)?[a]:r?[`https://lovable.dev`,`http://localhost:3000`]:[`https://lovable.dev`],s=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),c=(e,n,r)=>new Promise(i=>{let a=s(),c=!1,l,u=e=>{c||(c=!0,clearTimeout(l),window.removeEventListener(`message`,d),i(e))},d=e=>{if(o.indexOf(e.origin)<0)return;let t=e.data;t&&t.type===`lovable-preview-auth:result`&&t.requestId===a&&u(t)};window.addEventListener(`message`,d);let f={type:e,requestId:a,projectId:t,key:n};r!==void 0&&(f.value=r);for(let e of o)window.parent.postMessage(f,e);l=setTimeout(()=>u(null),2e3)}),l=!0;return{getItem:async e=>{let t=await c(`lovable-preview-auth:get`,e);return!t&&l&&(await new Promise(e=>setTimeout(e,250)),t=await c(`lovable-preview-auth:get`,e)),l=!1,t&&t.ok&&typeof t.value==`string`?t.value===``?(localStorage.removeItem(e),null):t.value:localStorage.getItem(e)},setItem:(e,t)=>(localStorage.setItem(e,t),c(`lovable-preview-auth:set`,e,t).then(()=>void 0)),removeItem:e=>(localStorage.removeItem(e),c(`lovable-preview-auth:remove`,e).then(()=>void 0))}}function ih(e){return e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`)}function ah(e){return(t,n)=>{let r=new Headers(typeof Request<`u`&&t instanceof Request?t.headers:void 0);return n?.headers&&new Headers(n.headers).forEach((e,t)=>r.set(t,e)),ih(e)&&r.get(`Authorization`)===`Bearer ${e}`&&r.delete(`Authorization`),r.set(`apikey`,e),fetch(t,{...n,headers:r})}}function oh(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_SUPABASE_PROJECT_ID:`ckggnxrxdsieukpzefpr`,VITE_SUPABASE_PUBLISHABLE_KEY:`sb_publishable_jtAvUmRrLdqKMaG611XBSw_iFZO4ce5`,VITE_SUPABASE_URL:`https://ckggnxrxdsieukpzefpr.supabase.co`}.VITE_SUPABASE_URL||{}.SUPABASE_URL,t={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_SUPABASE_PROJECT_ID:`ckggnxrxdsieukpzefpr`,VITE_SUPABASE_PUBLISHABLE_KEY:`sb_publishable_jtAvUmRrLdqKMaG611XBSw_iFZO4ce5`,VITE_SUPABASE_URL:`https://ckggnxrxdsieukpzefpr.supabase.co`}.VITE_SUPABASE_PUBLISHABLE_KEY||{}.SUPABASE_PUBLISHABLE_KEY;if(!e||!t){let n=`Missing Supabase environment variable(s): ${[...e?[]:[`SUPABASE_URL`],...t?[]:[`SUPABASE_PUBLISHABLE_KEY`]].join(`, `)}. Connect Supabase in Lovable Cloud.`;throw console.error(`[Supabase] ${n}`),Error(n)}return th(e,t,{global:{fetch:ah(t)},auth:{storage:rh(),persistSession:!0,autoRefreshToken:!0}})}var sh,ch=new Proxy({},{get(e,t,n){return sh||=oh(),Reflect.get(sh,t,n)}}),lh=ll({type:`function`}).client(async({next:e})=>{let{data:t}=await ch.auth.getSession(),n=t.session?.access_token;return e({headers:n?{Authorization:`Bearer ${n}`}:{}})}),uh=ll(),dh=void 0,fh=dl(()=>({functionMiddleware:[lh],requestMiddleware:[uh,dh]})),ph=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mh=new class extends ph{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},hh={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gh=new class{#e=hh;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function _h(e){setTimeout(e,0)}var vh=typeof window>`u`||`Deno`in globalThis;function yh(){}function bh(e,t){return typeof e==`function`?e(t):e}function xh(e){return typeof e==`number`&&e>=0&&e!==1/0}function Sh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ch(e,t){return typeof e==`function`?e(t):e}function wh(e,t){return typeof e==`function`?e(t):e}function Th(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Dh(o,t.options))return!1}else if(!kh(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Eh(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Oh(t.options.mutationKey)!==Oh(a))return!1}else if(!kh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Dh(e,t){return(t?.queryKeyHashFn||Oh)(e)}function Oh(e){return JSON.stringify(e,(e,t)=>Nh(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function kh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=Mh(e)&&Mh(t);if(!r&&!(Nh(e)&&Nh(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{gh.setTimeout(t,e)})}function Ih(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:jh(e,t)}function Lh(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Rh(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zh=Symbol();function Bh(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zh?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vh(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Hh=(()=>{let e=()=>vh;return{isServer(){return e()},setIsServer(t){e=t}}})();function Uh(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Wh=_h;function Gh(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Wh,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Kh=Gh(),qh=new class extends ph{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Jh(e){return Math.min(1e3*2**e,3e4)}function Yh(e){return(e??`online`)!==`online`||qh.isOnline()}var Xh=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Zh(e){let t=!1,n=0,r,i=Uh(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Xh(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>mh.isFocused()&&(e.networkMode===`always`||qh.isOnline())&&e.canRun(),u=()=>Yh(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Hh.isServer()?0:3),o=e.retryDelay??Jh,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&nl()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Qh=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xh(this.gcTime)&&(this.#e=gh.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hh.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(gh.clearTimeout(this.#e),this.#e=void 0)}};function $h(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Vh(e,()=>t.signal,()=>n=!0)},u=Bh(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Rh:Lh;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?tg:eg,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:eg(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function eg(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function tg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ng=class extends Qh{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ag(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ag(this.options);e.data!==void 0&&(this.setState(ig(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ih(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(yh).catch(yh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>wh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ch(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Sh(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Bh(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?$h(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Zh({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Xh&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Xh){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...rg(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ig(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Kh.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function rg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yh(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ig(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ag(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var og=class extends Qh{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||sg(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Zh({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Kh.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function sg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var cg=class extends ph{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new og({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=lg(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=lg(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=lg(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=lg(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Kh.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Eh(t,e))}findAll(e={}){return this.getAll().filter(t=>Eh(e,t))}notify(e){Kh.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Kh.batch(()=>Promise.all(e.map(e=>e.continue().catch(yh))))}};function lg(e){return e.options.scope?.id}var ug=class extends ph{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Dh(r,t),a=this.get(i);return a||(a=new ng({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Kh.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Th(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Th(e,t)):t}notify(e){Kh.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Kh.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kh.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dg=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ug,this.#t=e.mutationCache||new cg,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=mh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=qh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ch(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=bh(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Kh.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Kh.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Kh.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Kh.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(yh).catch(yh)}invalidateQueries(e,t={}){return Kh.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Kh.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(yh)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(yh)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ch(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yh).catch(yh)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yh).catch(yh)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return qh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Oh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{kh(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Oh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{kh(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Dh(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===zh&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},fg=L.createContext(void 0),pg=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(fg.Provider,{value:e,children:t})),mg=`/assets/styles-CHBbbCD1.css`;function hg(e,t={}){if(typeof window>`u`)return;window.__lovableEvents?.captureException?.(e,{source:`react_error_boundary`,route:window.location.pathname,...t},{mechanism:`react_error_boundary`,handled:!1,severity:`error`});let n=e instanceof Response?`Response ${e.status}${e.url?` at ${e.url}`:``}`:e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack:void 0;window.__lovableReportRuntimeError?.({message:n,...r!==void 0&&{stack:r},filename:window.location.pathname})}var gg=`/assets/on-symbol-CIYV7ftj.png`;function _g(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),xg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Sg=`-`,Cg=[],wg=`arbitrary..`,Tg=e=>{let t=Og(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Dg(e);let n=e.split(Sg);return Eg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?yg(i,t):t:i||Cg}return n[e]||Cg}}},Eg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Eg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Sg):e.slice(t).join(Sg),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?wg+r:void 0})(),Og=e=>{let{theme:t,classGroups:n}=e;return kg(n,t)},kg=(e,t)=>{let n=xg();for(let r in e){let i=e[r];Ag(i,n,r,t)}return n},Ag=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Mg(e,t,n);return}if(typeof e==`function`){Ng(e,t,n,r);return}Pg(e,t,n,r)},Mg=(e,t,n)=>{let r=e===``?t:Fg(t,e);r.classGroupId=n},Ng=(e,t,n,r)=>{if(Ig(e)){Ag(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bg(n,e))},Pg=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(Sg),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Lg=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Rg=`!`,zg=`:`,Bg=[],Vg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Hg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Vg(t,l,c,u)};if(t){let e=t+zg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Vg(Bg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ug=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Wg=e=>({cache:Lg(e.cacheSize),parseClassName:Hg(e),sortModifiers:Ug(e),postfixLookupClassGroupIds:Gg(e),...Tg(e)}),Gg=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Kg),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Rg:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},Jg=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=Wg(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=qg(e,n);return i(e,a),a};return a=o,(...e)=>a(Jg(...e))},Zg=[],Qg=e=>{let t=t=>t[e]||Zg;return t.isThemeGetter=!0,t},$g=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,e_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,t_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,n_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,i_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,s_=e=>t_.test(e),Z=e=>!!e&&!Number.isNaN(Number(e)),c_=e=>!!e&&Number.isInteger(Number(e)),l_=e=>e.endsWith(`%`)&&Z(e.slice(0,-1)),u_=e=>n_.test(e),d_=()=>!0,f_=e=>r_.test(e)&&!i_.test(e),p_=()=>!1,m_=e=>a_.test(e),h_=e=>o_.test(e),g_=e=>!Q(e)&&!$(e),__=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),v_=e=>N_(e,L_,p_),Q=e=>$g.test(e),y_=e=>N_(e,R_,f_),b_=e=>N_(e,z_,Z),x_=e=>N_(e,V_,d_),S_=e=>N_(e,B_,p_),C_=e=>N_(e,F_,p_),w_=e=>N_(e,I_,h_),T_=e=>N_(e,H_,m_),$=e=>e_.test(e),E_=e=>P_(e,R_),D_=e=>P_(e,B_),O_=e=>P_(e,F_),k_=e=>P_(e,L_),A_=e=>P_(e,I_),j_=e=>P_(e,H_,!0),M_=e=>P_(e,V_,!0),N_=(e,t,n)=>{let r=$g.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},P_=(e,t,n=!1)=>{let r=e_.exec(e);return r?r[1]?t(r[1]):n:!1},F_=e=>e===`position`||e===`percentage`,I_=e=>e===`image`||e===`url`,L_=e=>e===`length`||e===`size`||e===`bg-size`,R_=e=>e===`length`,z_=e=>e===`number`,B_=e=>e===`family-name`,V_=e=>e===`number`||e===`weight`,H_=e=>e===`shadow`,U_=Xg(()=>{let e=Qg(`color`),t=Qg(`font`),n=Qg(`text`),r=Qg(`font-weight`),i=Qg(`tracking`),a=Qg(`leading`),o=Qg(`breakpoint`),s=Qg(`container`),c=Qg(`spacing`),l=Qg(`radius`),u=Qg(`shadow`),d=Qg(`inset-shadow`),f=Qg(`text-shadow`),p=Qg(`drop-shadow`),m=Qg(`blur`),h=Qg(`perspective`),g=Qg(`aspect`),_=Qg(`ease`),v=Qg(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[$,Q,c],w=()=>[s_,`full`,`auto`,...C()],te=()=>[c_,`none`,`subgrid`,$,Q],ne=()=>[`auto`,{span:[`full`,c_,$,Q]},c_,$,Q],re=()=>[c_,`auto`,$,Q],ie=()=>[`auto`,`min`,`max`,`fr`,$,Q],ae=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],oe=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],se=()=>[`auto`,...C()],ce=()=>[s_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],le=()=>[s_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],ue=()=>[s_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],E=()=>[e,$,Q],D=()=>[...b(),O_,C_,{position:[$,Q]}],de=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],fe=()=>[`auto`,`cover`,`contain`,k_,v_,{size:[$,Q]}],pe=()=>[l_,E_,y_],O=()=>[``,`none`,`full`,l,$,Q],k=()=>[``,Z,E_,y_],A=()=>[`solid`,`dashed`,`dotted`,`double`],me=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],he=()=>[Z,l_,O_,C_],ge=()=>[``,`none`,m,$,Q],_e=()=>[`none`,Z,$,Q],ve=()=>[`none`,Z,$,Q],ye=()=>[Z,$,Q],be=()=>[s_,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[u_],breakpoint:[u_],color:[d_],container:[u_],"drop-shadow":[u_],ease:[`in`,`out`,`in-out`],font:[g_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[u_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[u_],shadow:[u_],spacing:[`px`,Z],text:[u_],"text-shadow":[u_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,s_,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[__],columns:[{columns:[Z,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[c_,`auto`,$,Q]}],basis:[{basis:[s_,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Z,s_,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Z,$,Q]}],shrink:[{shrink:[``,Z,$,Q]}],order:[{order:[c_,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...ae(),`normal`]}],"justify-items":[{"justify-items":[...oe(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...oe()]}],"align-content":[{content:[`normal`,...ae()]}],"align-items":[{items:[...oe(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...oe(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...oe(),`baseline`]}],"place-self":[{"place-self":[`auto`,...oe()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:se()}],mx:[{mx:se()}],my:[{my:se()}],ms:[{ms:se()}],me:[{me:se()}],mbs:[{mbs:se()}],mbe:[{mbe:se()}],mt:[{mt:se()}],mr:[{mr:se()}],mb:[{mb:se()}],ml:[{ml:se()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ce()}],"inline-size":[{inline:[`auto`,...le()]}],"min-inline-size":[{"min-inline":[`auto`,...le()]}],"max-inline-size":[{"max-inline":[`none`,...le()]}],"block-size":[{block:[`auto`,...ue()]}],"min-block-size":[{"min-block":[`auto`,...ue()]}],"max-block-size":[{"max-block":[`none`,...ue()]}],w:[{w:[s,`screen`,...ce()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ce()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ce()]}],h:[{h:[`screen`,`lh`,...ce()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ce()]}],"max-h":[{"max-h":[`screen`,`lh`,...ce()]}],"font-size":[{text:[`base`,n,E_,y_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,M_,x_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,l_,Q]}],"font-family":[{font:[D_,S_,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Z,`none`,$,b_]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...A(),`wavy`]}],"text-decoration-thickness":[{decoration:[Z,`from-font`,`auto`,$,y_]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Z,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[c_,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},c_,$,Q],radial:[``,$,Q],conic:[c_,$,Q]},A_,w_]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:k()}],"border-w-x":[{"border-x":k()}],"border-w-y":[{"border-y":k()}],"border-w-s":[{"border-s":k()}],"border-w-e":[{"border-e":k()}],"border-w-bs":[{"border-bs":k()}],"border-w-be":[{"border-be":k()}],"border-w-t":[{"border-t":k()}],"border-w-r":[{"border-r":k()}],"border-w-b":[{"border-b":k()}],"border-w-l":[{"border-l":k()}],"divide-x":[{"divide-x":k()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":k()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...A(),`hidden`,`none`]}],"divide-style":[{divide:[...A(),`hidden`,`none`]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...A(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Z,$,Q]}],"outline-w":[{outline:[``,Z,E_,y_]}],"outline-color":[{outline:E()}],shadow:[{shadow:[``,`none`,u,j_,T_]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":[`none`,d,j_,T_]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Z,y_]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":k()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":[`none`,f,j_,T_]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Z,$,Q]}],"mix-blend":[{"mix-blend":[...me(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Z]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Z]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:ge()}],brightness:[{brightness:[Z,$,Q]}],contrast:[{contrast:[Z,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,j_,T_]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:[``,Z,$,Q]}],"hue-rotate":[{"hue-rotate":[Z,$,Q]}],invert:[{invert:[``,Z,$,Q]}],saturate:[{saturate:[Z,$,Q]}],sepia:[{sepia:[``,Z,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Z,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Z,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Z,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Z,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Z,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Z,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Z,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Z,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Z,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Z,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":[`translate-none`],zoom:[{zoom:[c_,$,Q]}],accent:[{accent:E()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...E()]}],"stroke-w":[{stroke:[Z,E_,y_,b_]}],stroke:[{stroke:[`none`,...E()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function W_(...e){return U_(vg(e))}function G_({children:e,className:t}){return(0,R.jsx)(`div`,{className:W_(`mx-auto w-full max-w-[1400px] px-6 sm:px-8 lg:px-14`,t),children:e})}function K_({id:e,children:t,className:n}){return(0,R.jsx)(`section`,{id:e,className:W_(`py-20 sm:py-28 lg:py-36`,n),children:t})}function q_({children:e,as:t=`h2`,className:n}){return(0,R.jsx)(t,{className:W_({h1:`text-[clamp(2.75rem,7vw,5.5rem)]`,h2:`text-[clamp(2rem,4.2vw,3.75rem)]`,h3:`text-[clamp(1.25rem,2vw,1.75rem)]`}[t],`text-deep`,n),children:e})}function J_({children:e,className:t}){return(0,R.jsx)(`p`,{className:W_(`text-base leading-relaxed text-muted-foreground sm:text-lg`,t),children:e})}function Y_(){return(0,R.jsx)(`svg`,{viewBox:`0 0 12 12`,"aria-hidden":`true`,className:`size-3 shrink-0`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:(0,R.jsx)(`path`,{d:`M2.5 9.5 9.5 2.5M4 2.5h5.5V8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var X_=`inline-flex items-center justify-center gap-3 whitespace-nowrap rounded-xs px-6 py-3.5 eyebrow transition-colors duration-200`,Z_={solid:`bg-primary text-primary-foreground hover:bg-deep`,outline:`border border-primary/40 text-primary hover:bg-primary hover:text-primary-foreground`,light:`border border-primary-foreground/50 text-primary-foreground hover:bg-primary-foreground hover:text-primary`};function Q_({to:e,children:t,variant:n=`solid`,className:r}){let i=W_(X_,Z_[n],r);return e.startsWith(`/#`)?(0,R.jsxs)(`a`,{href:e,className:i,children:[(0,R.jsx)(`span`,{children:t}),(0,R.jsx)(Y_,{})]}):(0,R.jsxs)(Dc,{to:e,className:i,children:[(0,R.jsx)(`span`,{children:t}),(0,R.jsx)(Y_,{})]})}function $_({title:e,text:t,index:n,className:r}){return(0,R.jsxs)(`div`,{className:W_(`border-t border-border pt-5`,r),children:[n!==void 0&&(0,R.jsx)(`span`,{className:`eyebrow text-primary/50`,children:String(n).padStart(2,`0`)}),(0,R.jsx)(`h3`,{className:`mt-2 text-xl text-deep sm:text-2xl`,children:e}),(0,R.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground sm:text-base`,children:t})]})}var ev={name:`Nadia Oliver`,role:`Terapeuta psicanalista`,tagline:`Psicanálise · inteligência emocional · neurociência`,description:`Um espaço para olhar para dentro, compreender o que sente e construir escolhas mais alinhadas com quem você é.`},tv=[{label:`Terapias`,href:`/terapias`},{label:`Mentorias`,href:`/mentorias`},{label:`Yogaterapia`,href:`/yogaterapia`},{label:`Espaço ON`,href:`/loja`},{label:`Sobre`,href:`/sobre`},{label:`Artigos`,href:`/blog`}],nv=[{label:`Página inicial`,href:`/`},{label:`Contato`,href:`/contato`}],rv=[{label:`Política de Privacidade`,href:`/politica-de-privacidade`},{label:`Termos de Uso`,href:`/termos-de-uso`},{label:`Aviso Legal`,href:`/aviso-legal`}],iv={email:`contato@nadiaoliver.com.br`,responseTime:`Respondo pessoalmente em até 3 dias úteis.`},av={eyebrow:ev.tagline,title:`Quando você se escuta, a vida começa a fazer sentido.`,subtitle:ev.description,primaryCta:{label:`Conheça meu trabalho`,href:`/#sobre`},secondaryCta:{label:`Inteireza em Movimento`,href:`/#mentoria`},image:`/nadia/nadia-session-hero.webp`,imageAlt:`Sessão de terapia em uma sala clara com vista para o mar`,badge:`from the inside out`},ov={eyebrow:`from the inside out`,kicker:`Uma identidade entre mar e presença`,title:`Leveza também pode ser profunda.`,text:`Da cidade de praia onde vivo, levo para o meu trabalho o ritmo do mar, a luz do sol e a importância de criar pausas que nos devolvam ao essencial.`,image:{src:`/nadia/nadia-articles-new.webp`,alt:`Nadia Oliver de chapéu em um jardim iluminado pela luz da manhã`}},sv={eyebrow:`presença e clareza`,kicker:`Quem é Nadia Oliver?`,title:`Um olhar que integra mente, emoção, corpo e propósito.`,paragraphs:[`Sou Nadia Oliver, terapeuta psicanalista, especialista em inteligência emocional e neurociência, escritora e palestrante. Trabalho de forma integrativa, unindo e alinhando o seu eu from the inside out.`,`Minha prática inclui neurociência, filosofia, psicologia, coaching, metafísica, mindfulness, yoga e medicinas orientais. Diferentes conhecimentos se encontram para olhar o ser humano com mais inteireza.`],highlight:`Meu propósito de vida é trazer luz e clareza para que as pessoas possam ser livres.`,image:{src:`/nadia/nadia-sea-portrait.webp`,alt:`Nadia Oliver sorrindo em um ambiente claro com vista para o mar`},pillars:[{title:`Escuta`,text:`O que acontece por dentro importa.`},{title:`Integração`,text:`Conhecimento que encontra presença.`},{title:`Movimento`,text:`Clareza para escolher com liberdade.`}]},cv={eyebrow:`Mentoria · Inteireza em Movimento`,title:`Mais clareza para escolher. Mais presença para viver.`,text:`Uma jornada integrativa para unir quem você é, o que sente e a vida que deseja construir — com profundidade, leveza e direção.`,steps:[{title:`Reconhecer`,text:`Observar pensamentos, emoções e padrões com presença.`},{title:`Alinhar`,text:`Integrar conhecimento, escolhas e propósito pessoal.`},{title:`Expandir`,text:`Viver de forma coerente com a pessoa que você está se tornando.`},{title:`Praticar`,text:`Levar a consciência para as escolhas do cotidiano.`}],cta:{label:`Conheça a proposta`,href:`/#palestras`},image:{src:`/nadia/yoga-sea.webp`,alt:`Tapete de yoga e garrafa de fibras naturais diante do mar`}},lv={eyebrow:`Um caminho de dentro para fora`,title:`A sua vida também pode ter espaço para respirar.`,image:{src:`/nadia/pilates-light.webp`,alt:`Espaço claro com tapete para práticas de presença e movimento`}},uv={eyebrow:`Uma abordagem viva`,title:`Conhecimento que encontra o cotidiano.`,text:`A mente, as emoções e o corpo conversam o tempo todo. Por isso, meu trabalho combina diferentes perspectivas para tornar o autoconhecimento uma experiência possível, humana e presente.`,axes:[{title:`Mente`,text:`Psicanálise, psicologia e neurociência.`},{title:`Emoção`,text:`Consciência emocional e novas escolhas.`},{title:`Corpo`,text:`Mindfulness, yoga e pilates como presença.`},{title:`Propósito`,text:`Direção para uma vida mais coerente.`}],image:{src:`/nadia/sand-journal.webp`,alt:`Caderno aberto, pedra e concha sobre a areia diante do mar`}},dv={eyebrow:`Palestras e encontros`,title:`Da consciência à liberdade`,text:`Um convite para compreender o que acontece dentro, ampliar a consciência e transformar presença em direção para a vida.`,text2:`Para encontros que desejam falar sobre inteligência emocional, relações, propósito e a coragem de viver com mais verdade.`,cta:{label:`Explorar os temas`,href:`/#artigos`}},fv={eyebrow:`Profundidade com leveza`,title:`Você não precisa escolher entre acolhimento e direção.`,text:`Existe um jeito mais gentil de olhar para si sem abrir mão da responsabilidade pelas próprias escolhas. É nesse espaço de confiança que a transformação pode começar.`,words:[`Pausa`,`Presença`,`Clareza`,`Movimento`],images:[{src:`/nadia/nadia-garden-portrait.webp`,alt:`Nadia Oliver em um jardim iluminado pela luz da manhã`},{src:`/nadia/nadia-sea-reading.webp`,alt:`Nadia Oliver lendo diante do mar ao pôr do sol`}]},pv={eyebrow:`Reflexões para o caminho`,title:`Artigos para viver com mais clareza`,text:`Ideias para observar seus padrões, ampliar a consciência e escolher novos caminhos.`,cta:{label:`Ver todos os artigos`,href:`/blog`}},mv={eyebrow:`O próximo movimento começa dentro`,title:`Mais luz. Mais clareza. Mais liberdade para ser você.`,cta:{label:`Conheça a mentoria`,href:`/#mentoria`},image:{src:`/nadia/nadia-articles-new.webp`,alt:`Nadia Oliver ao ar livre`}},hv={eyebrow:`Nadia Oliver · Artigos`,title:`Pensar melhor também é uma forma de se cuidar.`,subtitle:`Reflexões para observar seus padrões, ampliar a consciência e escolher novos caminhos com mais presença.`,cta:{label:`Conheça a Nadia`,href:`/#sobre`},image:{src:`/nadia/nadia-garden.webp`,alt:`Mar turquesa e areia iluminados pelo sol`},listEyebrow:`Reflexões para o caminho`,listTitle:`Um lugar para voltar ao essencial.`,listText:`Artigos sobre emoções, relações, escolhas e liberdade interior.`},gv={eyebrow:`Terapias e sessões`,title:`Um espaço seguro para se escutar com profundidade.`,text:`Atendimentos individuais online e presenciais, com escuta psicanalítica e ferramentas de inteligência emocional, neurociência e práticas de presença.`,image:{src:`/nadia/nadia-sea-portrait.webp`,alt:`Nadia Oliver em atendimento com vista para o mar`},items:[{title:`Sessão de Escuta Psicanalítica`,duration:`50 minutos · online ou presencial`,text:`Um encontro para dar nome ao que você sente, compreender seus padrões e abrir espaço para novas escolhas.`},{title:`Sessão de Inteligência Emocional`,duration:`60 minutos · online`,text:`Ferramentas práticas de neurociência aplicada para regular emoções, reduzir reatividade e ganhar clareza.`},{title:`Yogaterapia ON`,duration:`60 minutos · presencial ou online`,text:`Respiração, movimento consciente e relaxamento profundo para devolver o corpo à conversa com a mente.`},{title:`Sessão Integrativa`,duration:`80 minutos · presencial`,text:`Escuta, prática corporal e direcionamento em um só encontro — o formato mais completo do meu trabalho.`}],note:`As sessões acontecem com agenda limitada para preservar a qualidade da escuta.`,cta:{label:`Quero agendar uma sessão`,href:`/contato`}},_v={eyebrow:`Meus programas`,title:`Mentorias para caminhar com direção.`,text:`Jornadas guiadas, com número reduzido de participantes, para transformar consciência em movimento real.`,items:[{number:`01`,name:`Inteireza em Movimento`,text:`A mentoria principal. Uma jornada de acompanhamento individual para alinhar quem você é, o que sente e a vida que deseja construir.`,detail:`12 semanas · individual · vagas limitadas`,cta:`Entrar na turma`},{number:`02`,name:`Raiz Firme`,name2:`Imersão`,text:`Uma imersão de aprofundamento para destravar padrões antigos, recuperar seu poder pessoal e voltar ao seu centro.`,detail:`Imersão de 2 dias · grupo pequeno`,cta:`Ver datas`},{number:`03`,name:`Protocolo Autoconfiança`,text:`Um percurso curto e direto para reconstruir sua autoimagem e parar de terceirizar seu valor na aprovação dos outros.`,detail:`4 semanas · online · em grupo`,cta:`Começar agora`}],scarcity:`Cada turma abre poucas vagas por ano. Entre na lista de espera para ser avisada primeiro.`},vv={eyebrow:`Aplicativo de yogaterapia`,title:`A sua prática diária, no ritmo do mar.`,text:`Um aplicativo para levar a yogaterapia para o seu dia a dia: respiração guiada, práticas curtas, relaxamento profundo e diário emocional — tudo em um só lugar, com a leveza de quem vive perto do mar.`,status:`Em desenvolvimento · lançamento em breve`,features:[{title:`Respire`,text:`Práticas de respiração guiadas para acalmar o sistema nervoso em minutos.`},{title:`Pratique`,text:`Aulas de yogaterapia de 10 a 40 minutos, para começar ou encerrar o dia.`},{title:`Sinta`,text:`Diário emocional simples para observar padrões e acompanhar sua evolução.`},{title:`Descanse`,text:`Yoga nidra e relaxamentos profundos para noites de sono mais restaurador.`}],waitlist:{title:`Entre para a lista de espera do app`,text:`As primeiras pessoas da lista recebem acesso antecipado e condição especial de fundadora no lançamento.`,scarcity:`Acesso antecipado limitado às primeiras inscrições.`}},yv={eyebrow:`Espaço ON Presença`,title:`Ferramentas de ancoragem para o seu spa em casa.`,text:`Cada item deste espaço foi desenhado e consagrado para ajudar você a desligar o ruído do mundo e ligar a sua própria presença. Vista o seu conforto, acenda a sua luz, prepare a sua Chaterapia e finque os seus pés no presente. Você está ON.`,featured:{eyebrow:`Lançamento · E-book`,name:`Mar Adentro`,subtitle:`Um Manual de Inteligência Emocional e Autoestima para a Mulher Madura`,text:`Meu primeiro livro, em formato e-book. Um guia prático para atravessar a maturidade com mais autoestima, clareza emocional e liberdade para recomeçar — unindo psicanálise, neurociência e inteligência emocional em linguagem simples.`,status:`Em breve · entre na lista de espera para receber a condição de lançamento.`},items:[{name:`Planner ON Presença`,text:`Planner de rotina consciente para organizar o dia com pausas, respiração e intenção — o companheiro do e-book Mar Adentro.`,image:`planner`},{name:`Caderno ON Maré`,text:`Caderno de escrita reflexiva para registrar pensamentos, emoções e clareza emocional.`,image:`caderno`},{name:`Cartas ON Presença`,text:`Baralho de cartas de yogaterapia com mensagens e instruções de prática para cada dia.`,image:`cards`},{name:`Vela ON Maresia`,text:`Vela artesanal de cera vegetal em cerâmica turquesa, para marcar o início da sua prática.`,image:`vela`},{name:`Caneca ON Duna`,text:`Caneca de cerâmica em tom areia com borda turquesa, para a sua Chaterapia diária.`,image:`caneca`},{name:`Tapete ON Areia`,text:`Tapete de yoga em cortiça natural na cor areia, com alça turquesa — conforto e aderência.`,image:`tapete`}],note:`Quer ser avisada quando o Espaço ON Presença abrir? Entre na lista de espera.`},bv={eyebrow:`Quem somos`,title:`Nadia Oliver e o nascimento do Espaço ON Presença.`,intro:`Sou Nadia Oliver, terapeuta psicanalista, especialista em inteligência emocional e neurociência, praticante e facilitadora de yogaterapia, escritora e palestrante. Há mais de uma década acompanho pessoas — em especial mulheres em fase de maturidade — em processos de escuta, reorganização emocional e reconstrução da autoestima.`,blocks:[{title:`Formação e experiência`,text:`Minha prática integra psicanálise, neurociência aplicada, inteligência emocional, mindfulness, yoga e medicinas orientais. Atendo em sessões individuais online e presenciais, conduzo mentorias e imersões e levo esses temas a palestras e encontros. Todo o conteúdo publicado aqui nasce dessa vivência clínica e de estudo contínuo.`},{title:`O propósito deste site`,text:`Este site existe para compartilhar conhecimento científico e prático sobre saúde emocional e bem-estar de forma acessível: artigos, reflexões e ferramentas que ajudem você a compreender o que sente e a fazer escolhas mais coerentes com quem é. O conteúdo é informativo e educativo e não substitui acompanhamento médico, psicológico ou psiquiátrico.`},{title:`O nascimento do Espaço ON Presença`,text:`Para consolidar essa metodologia e transformar conhecimento em ferramentas práticas, criei o Espaço ON Presença — que hoje reúne o aplicativo de yogaterapia, as mentorias personalizadas e a loja oficial, com o e-book Mar Adentro, o planner e os objetos de ritual que sustentam a prática no dia a dia.`},{title:`Confiança e transparência`,text:`Escrevo e reviso pessoalmente cada texto publicado. Respondo diretamente as mensagens recebidas pelo formulário de contato e trato os dados enviados conforme a Política de Privacidade e a LGPD.`}],image:{src:`/nadia/nadia-sea-portrait.webp`,alt:`Nadia Oliver sorrindo em um ambiente claro com vista para o mar`}},xv={eyebrow:`Contato e formulário`,title:`Vamos conversar sobre o seu momento.`,text:`Conte um pouco sobre você e o que está buscando. Respondo pessoalmente cada mensagem, dentro da minha agenda de atendimentos.`};function Sv({className:e}){return(0,R.jsxs)(Dc,{to:`/`,className:`flex items-center gap-3 ${e??``}`,children:[(0,R.jsx)(`img`,{src:gg,alt:``,"aria-hidden":`true`,width:1024,height:1024,className:`size-9 shrink-0`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`font-display text-xl font-semibold tracking-tight`,children:`Nadia `}),(0,R.jsx)(`span`,{className:`font-display text-xl font-normal italic tracking-tight`,children:`Oliver`})]})]})}function Cv(){let[e,t]=(0,L.useState)(!1);return(0,R.jsxs)(`header`,{className:`sticky top-0 z-50 border-b border-border/70 bg-background/90 backdrop-blur`,children:[(0,R.jsxs)(G_,{className:`flex h-16 items-center justify-between gap-8 lg:h-20`,children:[(0,R.jsx)(Sv,{className:`text-deep`}),(0,R.jsx)(`nav`,{className:`hidden items-center gap-8 lg:flex`,children:tv.map(e=>(0,R.jsx)(Dc,{to:e.href,className:`whitespace-nowrap text-sm text-muted-foreground transition-colors hover:text-primary`,activeProps:{className:`text-primary`},children:e.label},e.href))}),(0,R.jsxs)(Dc,{to:`/contato`,className:`hidden shrink-0 items-center gap-2 border border-primary/40 px-5 py-2.5 text-sm whitespace-nowrap text-primary transition-colors hover:bg-primary hover:text-primary-foreground lg:inline-flex`,children:[`Agendar `,(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>t(e=>!e),"aria-expanded":e,"aria-label":`Abrir menu`,className:`flex size-10 flex-col items-center justify-center gap-1.5 text-primary lg:hidden`,children:[(0,R.jsx)(`span`,{className:`block h-px w-6 bg-current`}),(0,R.jsx)(`span`,{className:`block h-px w-6 bg-current`})]})]}),e&&(0,R.jsx)(`div`,{className:`border-t border-border bg-background lg:hidden`,children:(0,R.jsxs)(G_,{className:`flex flex-col gap-1 py-6`,children:[tv.map(e=>(0,R.jsx)(Dc,{to:e.href,onClick:()=>t(!1),className:`border-b border-border/60 py-4 text-sm text-muted-foreground`,children:e.label},e.href)),(0,R.jsxs)(Dc,{to:`/contato`,onClick:()=>t(!1),className:`mt-4 inline-flex items-center justify-center gap-2 bg-primary px-5 py-4 text-sm text-primary-foreground`,children:[`Agendar `,(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]})]})})]})}var wv=`nadia-cookie-consent`;function Tv(){let[e,t]=(0,L.useState)(!1);(0,L.useEffect)(()=>{try{localStorage.getItem(wv)||t(!0)}catch{}},[]);function n(e){try{localStorage.setItem(wv,e)}catch{}t(!1)}return e?(0,R.jsx)(`div`,{role:`dialog`,"aria-label":`Aviso de cookies`,className:`fixed inset-x-0 bottom-0 z-50 border-t border-border bg-background/95 backdrop-blur`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-4 px-6 py-5 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between`,children:[(0,R.jsxs)(`p`,{className:`max-w-2xl leading-relaxed`,children:[`Usamos cookies essenciais para o funcionamento do site e, quando habilitada a publicidade, cookies de fornecedores terceiros (incluindo o Google) para exibir anúncios com base nas suas visitas a este e a outros sites. Saiba mais na`,` `,(0,R.jsx)(Dc,{to:`/politica-de-privacidade`,className:`underline underline-offset-4 hover:text-primary`,children:`Política de Privacidade`}),`.`]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(`rejected`),className:`whitespace-nowrap border border-border px-5 py-2 text-xs uppercase tracking-widest text-deep transition-colors hover:border-primary hover:text-primary`,children:`Recusar`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(`accepted`),className:`whitespace-nowrap bg-primary px-5 py-2 text-xs uppercase tracking-widest text-primary-foreground transition-opacity hover:opacity-90`,children:`Aceitar`})]})]})}):null}function Ev(){return(0,R.jsxs)(`footer`,{className:`border-t border-border bg-sand`,children:[(0,R.jsxs)(G_,{className:`flex flex-col gap-10 py-14 lg:flex-row lg:items-start lg:justify-between lg:py-20`,children:[(0,R.jsxs)(`div`,{className:`max-w-sm`,children:[(0,R.jsx)(Sv,{className:`text-deep`}),(0,R.jsxs)(`p`,{className:`mt-4 text-sm leading-relaxed text-muted-foreground`,children:[ev.role,` · especialista em inteligência emocional e neurociência. Um trabalho integrativo para unir mente, emoção, corpo e propósito.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:gap-16`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(`span`,{className:`eyebrow text-primary/60`,children:`Navegação`}),tv.map(e=>(0,R.jsx)(Dc,{to:e.href,className:`text-sm text-muted-foreground transition-colors hover:text-primary`,children:e.label},e.href))]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(`span`,{className:`eyebrow text-primary/60`,children:`Mais`}),nv.map(e=>(0,R.jsx)(Dc,{to:e.href,className:`text-sm text-muted-foreground transition-colors hover:text-primary`,children:e.label},e.href))]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(`span`,{className:`eyebrow text-primary/60`,children:`Legal`}),rv.map(e=>(0,R.jsx)(Dc,{to:e.href,className:`text-sm text-muted-foreground transition-colors hover:text-primary`,children:e.label},e.href))]})]})]}),(0,R.jsxs)(G_,{className:`flex flex-col gap-2 border-t border-border py-6 text-xs text-muted-foreground sm:flex-row sm:items-center sm:justify-between`,children:[(0,R.jsxs)(`span`,{children:[`© `,new Date().getFullYear(),` `,ev.name,`. Todos os direitos reservados.`]}),(0,R.jsx)(`span`,{className:`italic`,children:`from the inside out`})]})]})}function Dv(){return(0,R.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,R.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,R.jsx)(`h1`,{className:`text-7xl font-bold text-foreground`,children:`404`}),(0,R.jsx)(`h2`,{className:`mt-4 text-xl font-semibold text-foreground`,children:`Page not found`}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,R.jsx)(`div`,{className:`mt-6`,children:(0,R.jsx)(Dc,{to:`/`,className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Go home`})})]})})}function Ov({error:e,reset:t}){console.error(e);let n=Ms();return(0,L.useEffect)(()=>{hg(e,{boundary:`tanstack_root_error_component`})},[e]),(0,R.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,R.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground`,children:`This page didn't load`}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Something went wrong on our end. You can try refreshing or head back home.`}),(0,R.jsxs)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2`,children:[(0,R.jsx)(`button`,{onClick:()=>{n.invalidate(),t()},className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Try again`}),(0,R.jsx)(`a`,{href:`/`,className:`inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent`,children:`Go home`})]})]})})}var kv=jc()({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`Nadia Oliver`},{name:`author`,content:`Nadia Oliver`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}],links:[{rel:`stylesheet`,href:mg},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400..700;1,400..600&family=Instrument+Sans:ital,wght@0,400..600;1,400..500&display=swap`},{rel:`icon`,type:`image/png`,href:`/favicon.png`}]}),shellComponent:Av,component:jv,notFoundComponent:Dv,errorComponent:Ov});function Av({children:e}){return(0,R.jsxs)(`html`,{lang:`pt-BR`,children:[(0,R.jsx)(`head`,{children:(0,R.jsx)(ol,{})}),(0,R.jsxs)(`body`,{children:[e,(0,R.jsx)(sl,{})]})]})}function jv(){let{queryClient:e}=kv.useRouteContext();return(0,R.jsx)(pg,{client:e,children:(0,R.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,R.jsx)(Cv,{}),(0,R.jsx)(`main`,{className:`flex-1`,children:(0,R.jsx)(qc,{})}),(0,R.jsx)(Ev,{}),(0,R.jsx)(Tv,{})]})})}var Mv=`modulepreload`,Nv=function(e){return`/`+e},Pv={},Fv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Nv(t,n),t=s(t),t in Pv)return;Pv[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Mv,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Iv=()=>Fv(()=>import(`./routes-CZkuZ58v.js`),__vite__mapDeps([0,1,2,3,4])),Lv=`Nadia Oliver — Psicanálise, inteligência emocional e neurociência`,Rv=`Um espaço para olhar para dentro, compreender o que sente e construir escolhas mais alinhadas com quem você é.`,zv=Pc(`/`)({head:()=>({meta:[{title:Lv},{name:`description`,content:Rv},{property:`og:title`,content:Lv},{property:`og:description`,content:Rv},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(Iv,`component`)}),Bv=()=>Fv(()=>import(`./aviso-legal-C_kMxUiJ.js`),[]),Vv=`Aviso Legal e Isenção de Responsabilidade — Nadia Oliver`,Hv=`Conteúdo informativo sobre saúde emocional, psicanálise e yogaterapia. Este site não substitui diagnóstico, consulta ou tratamento profissional individualizado.`,Uv=Pc(`/aviso-legal`)({head:()=>({meta:[{title:Vv},{name:`description`,content:Hv},{property:`og:title`,content:Vv},{property:`og:description`,content:Hv},{property:`og:type`,content:`website`},{property:`og:url`,content:`/aviso-legal`},{name:`twitter:card`,content:`summary_large_image`}],links:[{rel:`canonical`,href:`/aviso-legal`}]}),component:Ic(Bv,`component`)}),Wv=()=>Fv(()=>import(`./blog-B7mHKjBz.js`),__vite__mapDeps([5,1])),Gv=`Artigos — Nadia Oliver`,Kv=`Reflexões para observar seus padrões, ampliar a consciência e escolher novos caminhos com mais presença.`,qv=Pc(`/blog`)({head:()=>({meta:[{title:Gv},{name:`description`,content:Kv},{property:`og:title`,content:Gv},{property:`og:description`,content:Kv},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(Wv,`component`)}),Jv=()=>Fv(()=>import(`./contato-iFY3B6hM.js`),__vite__mapDeps([6,2])),Yv=`Contato — Nadia Oliver`,Xv=`Fale com Nadia Oliver sobre atendimentos, mentorias, palestras e o app de yogaterapia.`,Zv=Pc(`/contato`)({head:()=>({meta:[{title:Yv},{name:`description`,content:Xv},{property:`og:title`,content:Yv},{property:`og:description`,content:Xv},{property:`og:type`,content:`website`},{property:`og:url`,content:`/contato`},{name:`twitter:card`,content:`summary_large_image`}],links:[{rel:`canonical`,href:`/contato`}],scripts:[{type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`ContactPage`,name:Yv,description:Xv,mainEntity:{"@type":`Person`,name:`Nadia Oliver`,jobTitle:`Terapeuta psicanalista`,email:`mailto:${iv.email}`}})}]}),component:Ic(Jv,`component`)}),Qv=()=>Fv(()=>import(`./loja-E0SVObRb.js`),__vite__mapDeps([7,2])),$v=`Espaço ON Presença — E-book Mar Adentro, planner e objetos de ritual`,ey=`Ferramentas de ancoragem para o seu spa em casa: o e-book Mar Adentro, planner, cartas de yogaterapia, velas, canecas e tapetes.`,ty=Pc(`/loja`)({head:()=>({meta:[{title:$v},{name:`description`,content:ey},{property:`og:title`,content:$v},{property:`og:description`,content:ey},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(Qv,`component`)}),ny=()=>Fv(()=>import(`./mentorias-CEOKd88I.js`),__vite__mapDeps([8,2])),ry=`Mentorias — Nadia Oliver`,iy=`Inteireza em Movimento, Imersão Raiz Firme e Protocolo Autoconfiança: jornadas com vagas limitadas para transformar consciência em movimento.`,ay=Pc(`/mentorias`)({head:()=>({meta:[{title:ry},{name:`description`,content:iy},{property:`og:title`,content:ry},{property:`og:description`,content:iy},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(ny,`component`)}),oy=()=>Fv(()=>import(`./politica-de-privacidade-N7APvCNd.js`),[]),sy=`Política de Privacidade — Nadia Oliver`,cy=`Como os seus dados pessoais são coletados, usados e protegidos neste site, em conformidade com a LGPD (Lei nº 13.709/2018).`,ly=Pc(`/politica-de-privacidade`)({head:()=>({meta:[{title:sy},{name:`description`,content:cy},{property:`og:title`,content:sy},{property:`og:description`,content:cy},{property:`og:type`,content:`website`},{property:`og:url`,content:`/politica-de-privacidade`}],links:[{rel:`canonical`,href:`/politica-de-privacidade`}]}),component:Ic(oy,`component`)}),uy=()=>Fv(()=>import(`./sobre-qDmxYUpO.js`),__vite__mapDeps([9,3])),dy=`Quem somos — Nadia Oliver e o Espaço ON Presença`,fy=`Conheça Nadia Oliver: terapeuta psicanalista, especialista em inteligência emocional e neurociência, e a história do Espaço ON Presença.`,py=Pc(`/sobre`)({head:()=>({meta:[{title:dy},{name:`description`,content:fy},{property:`og:title`,content:dy},{property:`og:description`,content:fy},{property:`og:type`,content:`profile`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(uy,`component`)}),my=()=>Fv(()=>import(`./terapias-CBA1wASH.js`),[]),hy=`Terapias e Sessões — Nadia Oliver`,gy=`Atendimentos individuais de escuta psicanalítica, inteligência emocional e yogaterapia, online e presenciais.`,_y=Pc(`/terapias`)({head:()=>({meta:[{title:hy},{name:`description`,content:gy},{property:`og:title`,content:hy},{property:`og:description`,content:gy},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(my,`component`)}),vy=()=>Fv(()=>import(`./termos-de-uso-CpYsxBXK.js`),[]),yy=`Termos de Uso — Nadia Oliver`,by=`Condições de uso do site de Nadia Oliver: conteúdo, propriedade intelectual, lista de espera e responsabilidades.`,xy=Pc(`/termos-de-uso`)({head:()=>({meta:[{title:yy},{name:`description`,content:by},{property:`og:title`,content:yy},{property:`og:description`,content:by},{property:`og:type`,content:`website`},{property:`og:url`,content:`/termos-de-uso`}],links:[{rel:`canonical`,href:`/termos-de-uso`}]}),component:Ic(vy,`component`)}),Sy=()=>Fv(()=>import(`./yogaterapia-e-AAVxcH.js`),__vite__mapDeps([10,2,4])),Cy=`App de Yogaterapia diária | Nadia Oliver`,wy=`O app leva a yogaterapia para o seu dia a dia: respiração guiada, práticas curtas e relaxamento profundo. Entre na lista de espera do lançamento.`,Ty=Pc(`/yogaterapia`)({head:()=>({meta:[{title:Cy},{name:`description`,content:wy},{property:`og:title`,content:Cy},{property:`og:description`,content:wy},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:Ic(Sy,`component`)}),Ey=[{slug:`desabafar-vale-a-pena`,title:`Quando o desabafo não resolve`,excerpt:`Falar pode aliviar, mas a mudança começa quando você transforma consciência em ação.`,cover:`/nadia/sand-journal.webp`,date:null,blocks:[{type:`p`,text:`Aqui, eu serei direta com você: desabafar está atrasando a sua vida.`},{type:`p`,text:`Imagine o seguinte cenário: é sexta-feira, final do seu expediente de trabalho e acontece um problema gigantesco, que certamente te fará trabalhar até mais tarde. Qual é o seu primeiro impulso? Talvez mandar mensagem para aquela sua colega, que vai ouvir a sua reclamação e dizer “nossa, amiga, coitadinha de você”.`},{type:`p`,text:`Vamos falar a verdade? Quem nunca passou por uma situação assim?`},{type:`p`,text:`Algo frustrante acontece e você logo corre para desabafar com alguém. Seja sobre a sua vida profissional, seu relacionamento, sua mãe, sua sogra, qualquer coisa.`},{type:`p`,text:`E, sim, esse sentimento confortável de “colocar para fora” o seu incômodo pode até ser bom no primeiro momento. Mas a verdade é que esse hábito está matando uma parte muito importante de você.`},{type:`h2`,text:`Desabafar te coloca como vítima`},{type:`p`,text:`O desabafo tem um fundo de vitimização e carrega consigo a intenção de buscar um colo. Ele traz alívio, mas não patrocina a sua cura. Por isso, precisamos nos treinar para ter disciplina de buscar cura, em vez de colo.`},{type:`p`,text:`Desabafar não vai mudar o que aconteceu, não vai te fazer refletir sobre quais ações você verdadeiramente pode fazer para solucionar aquela situação e, muito menos, vai te fazer olhar para dentro e buscar entender a raiz do desconforto que você sentiu.`},{type:`p`,text:`É importante aqui entender uma coisa: existe uma diferença entre desabafar e troca. Essa diferença é a motivação por trás dessas duas coisas.`},{type:`ul`,items:[`Desabafo: Tom de vitimismo. Queremos um reforço de que aquilo que nos aconteceu foi uma injustiça. Queremos apenas escutar o que nos trará alívio.`,`Troca: Estamos abertos para receber coisas difíceis, como críticas e pontos de vista diferentes dos nossos.`]},{type:`p`,text:`Para saber se estamos desabafando ou trocando ideias, basta investigar a nossa motivação por trás da conversa. Quando desabafamos e a outra pessoa nos provoca a refletir sobre a situação, isso causa um desconforto interno. É preciso honestidade sobre a nossa verdadeira motivação, para não se enganar e maquiar o desabafo.`},{type:`p`,text:`O desabafo é uma cilada não só quando é evidente, mas principalmente quando está maquiado de busca pela cura.`},{type:`h2`,text:`Como lidar com gente que reclama demais?`},{type:`p`,text:`Talvez você já tenha passado por isso. Alguém chega para desabafar com você, trazendo um discurso cheio de reclamações e querendo colo.`},{type:`p`,text:`E o que você faz? Concorda com tudo o que aquela pessoa está dizendo. E na expectativa de encerrar aquele assunto o mais rápido possível, você dá colo e não cura.`},{type:`p`,text:`Mas existe uma técnica INFALÍVEL e muito simples para lidar com essa situação, sem perder o seu tempo ou baixar a sua energia, sendo um agente de cura na vida daquela pessoa reclamona.`},{type:`p`,text:`Essa técnica também pode abrir uma conversa importante sobre limites, presença e responsabilidade emocional.`}]},{slug:`ter-vaidade-nao-e-ruim`,title:`Ego, vaidade e essência: o que está guiando você?`,excerpt:`Reconhecer o desejo de ser vista é diferente de deixar que ele conduza suas escolhas.`,cover:`/nadia/pilates-light.webp`,date:null,blocks:[{type:`p`,text:`Você acredita que ter vaidade é uma coisa ruim? Você acha que agir pela sua vontade de ser vista, de ser reconhecida, é negativo?`},{type:`p`,text:`E se eu te disser que existe uma forma de atender ao desejo do nosso ego de ser reconhecido, mas ainda assim atender ao desejo da nossa essência de transbordar amor para o mundo?`},{type:`p`,text:`É sobre isso, sobre a relação entre vaidade e essência, que vamos falar hoje.`},{type:`h2`,text:`Ter vaidade não é ruim, é humano`},{type:`p`,text:`Afinal, o que é vaidade?`},{type:`p`,text:`Vaidade nada mais é do que uma preocupação excessiva com a forma como as outras pessoas te enxergam. Ela é uma necessidade de ser aplaudida, reconhecida, vista pelo mundo.`},{type:`p`,text:`E, claro, ela é uma necessidade que nasce do ego.`},{type:`p`,text:`No geral, as pessoas têm muita dificuldade de admitir as suas vaidades. Ninguém gosta de dizer que é vaidoso.`},{type:`p`,text:`Mas suas vaidades existem, quer você goste ou não. Quer você admita ou não.`},{type:`p`,text:`Sai na frente quem olha para dentro, se investiga e reconhece as próprias vaidades.`},{type:`p`,text:`Sabe por quê? Como eu disse, as vaidades abastecem o seu ego. Admiti-las é também admitir que o seu ego existe.`},{type:`p`,text:`E todo mundo tem uma ideia pré-formada de que o ego é ruim. De que você precisa se livrar dele.`},{type:`p`,text:`Só que, na condição humana, é impossível atingir essa expectativa ilusória de que algum dia você será 100% essência.`},{type:`p`,text:`Ninguém é 100% nada.`},{type:`p`,text:`Será que é razoável a gente considerar que algum dia você não terá mais ego? Será que isso não faria de você sobre humana?`},{type:`p`,text:`Eu gosto de trabalhar com a hipótese de que o nosso ego existe e que nós não devemos querer matá-lo, mas sim trabalhar para conseguir reconhecer quando estamos a serviço do ego.`},{type:`p`,text:`Se você admite ter vaidade, você se permite atender o ego neste ponto, consciente do que está fazendo.`},{type:`p`,text:`E é justamente por ter clareza dos momentos em que você está atendendo ao seu ego, que você sai do risco de que ele te domine sem que você perceba.`},{type:`h2`,text:`O jeito certo de admitir ter vaidade`},{type:`p`,text:`À essa altura, você já entendeu que é preciso admitir que você tem vaidade, certo?`},{type:`p`,text:`Mas existe um jeito certo de fazer isso. Um jeito leve, que vai te permitir olhar para essa vaidade sem auto julgamento.`},{type:`p`,text:`Para fazer isso, é necessário cultivar dois hábitos específicos: o hábito da auto investigação neutra e o hábito da prática da humildade.`},{type:`h2`,text:`A auto investigação`},{type:`p`,text:`Esse primeiro hábito é importante para toda a sua jornada de autoconhecimento.`},{type:`p`,text:`Gosto de especificar que essa auto investigação precisa ser neutra, porque, para que ela seja eficiente, você precisa abrir mão do auto julgamento.`},{type:`p`,text:`O que seria abrir mão do auto julgamento?`},{type:`p`,text:`É treinar a sua habilidade de olhar para o que você sente, pensa e faz, sem atribuir qualidades positivas ou negativas para o que você observa.`},{type:`p`,text:`É você cultivar o hábito de olhar com curiosidade para aquilo que acontece do lado de dentro, sem a necessidade de classificar como bom ou ruim.`},{type:`p`,text:`Acontece que essa prática precisa de treino. E quanto mais treino, mais automática ela fica. Somente praticando isso todos os dias, você conseguirá tornar esse processo mais fácil.`},{type:`h2`,text:`A humildade`},{type:`p`,text:`O segundo hábito é a prática da humildade.`},{type:`p`,text:`E eu digo humildade não no sentido piegas. Mas a humildade de admitir que você tem ego e que, muitas vezes, suas escolhas são direcionadas para atender às necessidades dele.`},{type:`p`,text:`Fazer escolhas que atendam ao ego não faz de você uma pessoa pior.`},{type:`p`,text:`Lembre-se: você é humana e todo ser humano tem ego e tem essência.`},{type:`p`,text:`O desafio é aprender a reconhecer os momentos em que você está a serviço de um ou de outro. Pergunte-se:`},{type:`ul`,items:[`Esse desejo vem do meu ego ou da minha essência?`,`Será que essa decisão tão importante na minha vida deve ser tomada a serviço do meu ego?`]},{type:`p`,text:`Para a segunda pergunta, talvez a melhor resposta seja não.`},{type:`p`,text:`Contudo, para decisões menores e que não têm tanto impacto, que não trazem consequências e preços tão caros, como “será que eu vou comer uma sobremesa hoje ou não?“, “será que eu vou ou não nessa festa?“, talvez você possa dizer sim para o seu ego.`},{type:`p`,text:`O ego busca prazer, conforto, recompensa imediata.`},{type:`p`,text:`E é verdade que quando você está comendo brigadeiro, você busca sentir prazer agora. Você não está preocupada com a sua saúde amanhã ou se a calça jeans vai fechar depois de amanhã.`},{type:`p`,text:`Você só está preocupada em ter a satisfação momentânea.`},{type:`p`,text:`Desde que você saiba disso, você consegue fazer escolhas mais conscientes e equilibrar a sua vida.`},{type:`p`,text:`Você consegue construir uma vida que não seja inteira programada para prazeres imediatos. Uma vida que não seja inteira dominada e comandada pelo ego.`},{type:`p`,text:`Quando você ganha clareza dos momentos nos quais você está atendendo ao seu ego, quando você consegue admitir isso, você começa, de uma forma menos amedrontada, a reconhecer quais são as suas vaidades.`},{type:`h2`,text:`Dê nome às suas vaidades`},{type:`p`,text:`Admitir que você tem vaidades é o primeiro passo. Agora, você precisa identificar quais são elas e dar nome a cada uma delas.`},{type:`p`,text:`Quais são os atributos que você gostaria de mostrar para o mundo? O que você gostaria que o mundo admirasse em você?`},{type:`p`,text:`Ter essas vaidades dentro de você significa assumir que essas vaidades, hora ou outra, vão te seduzir. E, se você não tiver clareza de que você está fazendo escolhas e agindo em prol da sua vaidade, você vai se perder no caminho.`},{type:`p`,text:`Você vai se atropelar e se deixar ser comandada por essas vaidades.`},{type:`p`,text:`Por isso, liste as suas vaidades e esteja ciente delas. É bem provável que esse processo seja desconfortável, mas eu te garanto que vale a pena.`},{type:`h2`,text:`O equilíbrio entre ter vaidade e ter essência`},{type:`p`,text:`Existe uma forma de direcionar as suas vaidades e a sua essência para o mesmo lugar.`},{type:`p`,text:`Vamos supor que você identifique ter a sua vaidade ancorada na quantidade de dinheiro que você ganha.`},{type:`p`,text:`Sozinha, essa vaidade pode te levar para diversos caminhos profissionais, certo? Caminhos esses que não necessariamente vão atender às necessidades da sua essência.`},{type:`p`,text:`Mas, será que não existe uma forma de ganhar dinheiro e, ao mesmo tempo, ajudar as pessoas e transbordar coisas boas para o mundo?`},{type:`p`,text:`É nessa reflexão que mora o equilíbrio entre o ego e a essência.`},{type:`p`,text:`Eu, por exemplo, tenho a admiração dos outros como uma vaidade minha. Mas, particularmente, eu não gosto de ser admirada por quanto faturo no mês.`},{type:`p`,text:`O que me preenche é perceber como a consciência pode abrir espaço para escolhas mais livres. É esse encontro entre conhecimento e prática que sustenta o meu trabalho e a jornada de quem decide olhar para dentro.`},{type:`p`,text:`Percebe como é possível usar uma necessidade do ego (admiração) e direcioná-la a uma necessidade da essência (ajudar as pessoas)?`},{type:`p`,text:`Quando você consegue direcionar a sua vaidade para o mesmo rumo da sua essência, bingo!`},{type:`h2`,text:`O comando é da essência`},{type:`p`,text:`A essência clama por transbordar para o mundo as transformações que você faz dentro de si.`},{type:`p`,text:`Se a sua vaidade e a sua essência estão apontando para direções diferentes, provavelmente, exista um conflito interno gigantesco dentro de você.`},{type:`p`,text:`Esse mesmo conflito interno existe dentro de todas as pessoas que ainda não tiveram a humildade de reconhecer que têm sim vaidades e que ainda não tiveram a sabedoria de direcioná-las à serviço da própria essência.`},{type:`p`,text:`O mantra é: vaidade alinhada a serviço da essência, e não o contrário.`},{type:`p`,text:`O comando é da essência. É ela quem dá a direção para a vaidade se alinhar.`},{type:`p`,text:`Essa história de ceder e deixar a vaidade te comandar é uma armadilha. O ego se apega aos aplausos e está disposto a sacrificar praticamente qualquer coisa para conseguí-los.`},{type:`p`,text:`Por isso, permita-se investigar. Admita as suas vaidades e cuide de manter o comando das suas ações nas mãos da sua essência.`},{type:`p`,text:`Você transborda para o mundo aquilo que sobra do lado de dentro. Se você estiver esgotada, você não vai conseguir transbordar energia, vitalidade, luz para vida de ninguém.`},{type:`p`,text:`Então, acolha a dualidade que existe em você e permita-se ser humana.`}]},{slug:`como-aumentar-o-seu-merecimento`,title:`Merecimento não é espera: é construção`,excerpt:`Uma reflexão sobre como escolhas, presença e responsabilidade participam da vida que você deseja criar.`,cover:`/nadia/yoga-sea.webp`,date:`27 de setembro de 2024`,blocks:[{type:`p`,text:`Você já ouviu falar que aumentar seu merecimento é a chave para uma vida abundante, cheia de realizações, felicidade e sucesso?`},{type:`p`,text:`Uma vida em que você se sente verdadeiramente merecedora de tudo de bom que o universo tem a oferecer?`},{type:`p`,text:`Eu concordo em partes com essa teoria.`},{type:`p`,text:`Neste texto, eu quero te convidar a entender mais profundamente o que merecimento significa e te provar que apenas sentir que você merece algo não é suficiente.`},{type:`h2`,text:`A verdade sobre o merecimento`},{type:`p`,text:`Antes de mais nada, preciso te dizer uma verdade que pode ser um pouco difícil de engolir: você não merece nada só porque existe.`},{type:`p`,text:`A vida não te deve nada, o mundo não te deve nada.`},{type:`p`,text:`Seu merecimento precisa ser construído, conquistado, dia após dia, com suas ações e escolhas.`},{type:`p`,text:`Muita gente vive com a mentalidade de “eu mereço”, “eu tenho direito”, achando que o mundo gira em torno delas.`},{type:`p`,text:`Mas esse é um senso de merecimento infantilizado, ilusório.`},{type:`p`,text:`O verdadeiro merecimento é aquele que nasce das suas atitudes, das suas entregas, do valor que você agrega ao mundo.`},{type:`h2`,text:`Seu merecimento é proporcional à sua entrega`},{type:`p`,text:`Se você quer aumentar seu merecimento, a primeira coisa que precisa fazer é entregar mais.`},{type:`p`,text:`Se você se contenta com o mediano, com o “mais ou menos”, o seu nível de merecimento também será mediano.`},{type:`p`,text:`Pensa comigo: se você faz o mínimo necessário, se entrega um trabalho sem capricho, se não se esforça para ir além, como espera receber coisas incríveis e surpreendentes em troca?`},{type:`p`,text:`Você pode até se contar uma historinha, de forma iludida, de que você merece mais, mas o seu senso de merecimento é equivalente ao transbordamento que você faz para o mundo.`},{type:`p`,text:`Quando você é uma pessoa que justifica mais do que faz, você está abaixando o seu senso de merecimento.`},{type:`p`,text:`Quando você é uma pessoa que quando faz as coisas não tem a intenção de querer gerar um efeito de encantamento, de entregar mais do que te pediram, você está abaixando o seu senso de merecimento.`},{type:`p`,text:`Todas as vezes que você se preocupa mais com o “melhor feito, do que perfeito”, você está abaixando o seu senso de merecimento.`},{type:`p`,text:`Então, para aumentar seu merecimento, você precisa colocar sua alma em tudo o que faz.`},{type:`p`,text:`Entregue o seu melhor em todas as áreas da sua vida: no trabalho, nos relacionamentos, nos seus projetos pessoais.`},{type:`p`,text:`Faça com que as pessoas se encantem com o seu trabalho, com a sua dedicação, com o seu comprometimento.`},{type:`h2`,text:`Aumentar seu merecimento significa mudar de mentalidade`},{type:`p`,text:`Outro ponto importante para aumentar seu merecimento é cultivar uma mentalidade de abundância.`},{type:`p`,text:`Muitas pessoas vivem com uma mentalidade de escassez, acreditando que não há o suficiente para todos, que precisam lutar e competir para conseguir o que querem.`},{type:`p`,text:`Essa mentalidade te impede de enxergar as oportunidades que a vida te oferece, te faz se contentar com pouco e te impede de aumentar seu merecimento.`},{type:`p`,text:`Em vez disso, cultive uma mentalidade de abundância.`},{type:`p`,text:`Acredite que há o suficiente para todos, que você merece o melhor e que a vida está cheia de possibilidades.`},{type:`p`,text:`Quando você muda a sua mentalidade, você muda a sua realidade.`},{type:`h2`,text:`Para aumentar o seu merecimento, comece agradecendo`},{type:`p`,text:`A prática da gratidão é outro fator importante para aumentar o seu merecimento.`},{type:`p`,text:`Isso porque merecimento é sobre reconhecer o seu valor, a sua capacidade de realizar e de contribuir com o mundo.`},{type:`p`,text:`É sobre ter consciência de que você é digna de receber o que a vida tem a oferecer.`},{type:`p`,text:`Quando você agradece pelas coisas boas que acontecem na sua vida, você reconhece que fez por merecer.`},{type:`p`,text:`Você se conecta com a abundância do universo e se abre para receber ainda mais.`},{type:`p`,text:`A gratidão te permite enxergar os resultados das suas ações e te dá a certeza de que você está no caminho certo.`},{type:`p`,text:`Então, a minha dica pra você é: faça uma lista de tudo aquilo que você é grata, desde as pequenas coisas do dia a dia até as grandes conquistas da sua vida.`},{type:`p`,text:`Agradeça pelas oportunidades, pelos desafios e pelos aprendizados.`},{type:`p`,text:`Por ser quem você é, com todas as suas qualidades e imperfeições.`},{type:`p`,text:`Agradeça por ter a coragem de olhar para si e trabalhar na sua própria evolução.`},{type:`p`,text:`O verdadeiro merecimento mora no movimento, e esse movimento só depende de você.`}]},{slug:`como-voce-lida-com-a-noticia-ruim`,title:`Receber o inesperado sem perder o centro`,excerpt:`Diante de uma notícia difícil, a forma como você se posiciona também pode ser cuidada.`,cover:`/nadia/nadia-sea-reading.webp`,date:`16 de agosto de 2024`,blocks:[{type:`p`,text:`Como você lida com a notícia ruim?`},{type:`p`,text:`Quando a notícia ruim bate na sua porta, qual é a sua primeira reação?`},{type:`p`,text:`A notícia ruim.`},{type:`p`,text:`Quando ela bate na sua porta, você não quer abrir.`},{type:`p`,text:`“Deixa eu fingir que não é comigo. Deixa eu me contar a história de que só acontece com o vizinho.”`},{type:`p`,text:`A gente sabe que a vida é frágil, mas insiste em acreditar que, se formos fortes, estaremos protegidas.`},{type:`p`,text:`E a vida sempre dá um jeitinho de mostrar que a nossa força está em SER.`},{type:`p`,text:`Quem você é?`},{type:`p`,text:`Essa é a única certeza que você consegue ter. Mesmo assim, minoria tem... e se eu te perguntar quem você é, talvez você nem saiba me responder. Porque esse tempo todo você esteve mais preocupada em FAZER. E talvez o fazer seja sua maior distração.`},{type:`p`,text:`Quantas coisas você faz para dizer, depois, que não tem nem tempo de SER?`},{type:`p`,text:`Quantas funções você acumula para justificar que não te resta tempo para se conhecer?`},{type:`p`,text:`Essa semana eu levei um susto. A vida me entregou um envelope. E eu entendi o recado.`},{type:`p`,text:`“Não é comigo, mas é para mim.”`},{type:`p`,text:`Aconteceu justo no dia em que acordei decidida a cancelar projetos e planos, em nome da minha paz. Acordei angustiada. E angústia não me deixa assustada. Me deixa curiosa.`},{type:`p`,text:`Comecei o dia puxando o fio e entendendo o que eu estava disposta a NÃO FAZER, para continuar a SER.`},{type:`p`,text:`Eis que no final do dia, no meio de muitos afazeres, a notícia ruim bateu na minha porta. O primeiro impacto não foi dolorido, confesso. A gente leva um tempo para entender que não é um filme. Leva-se um tempo para entender que é real.`},{type:`p`,text:`“Será que eu deveria estar mais triste do que estou?”`},{type:`p`,text:`Comecei assim...`},{type:`p`,text:`Mas na medida que digeri a realidade, a pergunta mudou:`},{type:`p`,text:`“Será que eu deveria estar mais forte do que estou?”`},{type:`p`,text:`Vai ser assim. Vai ser um processo. Em alguns momentos, nem vou lembrar que alguém tão importante para mim carrega no próprio corpo uma das doenças que mais me assusta. Em outros, nem vou me constranger em chorar.`},{type:`p`,text:`“Mas nem é no seu corpo, para de drama!” – ontem eu me repreendi.`},{type:`p`,text:`“Não é no meu corpo, mas é no meu campo!” – foi isso que me respondi.`},{type:`p`,text:`Nada que me envolver é por acaso. Se me envolve, é sobre mim.`},{type:`p`,text:`Eu decidi sentar na cadeira de aprendiz. Eu já tinha uma grande amiga. Mas agora ela mudou de prateleira. Ganhei uma grande professora.`},{type:`p`,text:`E, sentada na cadeira de aluna, me comprometo a compartilhar com vocês todas as lições que eu puder aprender.`},{type:`p`,text:`A vida é sempre generosa, desde que a gente saiba ser. E a vida é sempre um presente – desde que a gente saiba receber.`},{type:`p`,text:`Se você acolhe suas notícias ruins com o coração, o que poderia ser desesperador se torna sua maior lição.`}]},{slug:`como-sair-de-um-relacionamento-abusivo`,title:`Quando o limite vira liberdade`,excerpt:`Reconhecer o que fere e reconstruir espaço para si pode ser o início de uma nova escolha.`,cover:`/nadia/nadia-sea-portrait.webp`,date:`4 de setembro de 2024`,blocks:[{type:`p`,text:`“Como sair de um relacionamento abusivo?”. Se você chegou até aqui com essa for a sua pergunta, saiba que eu também já estive na sua pele.`},{type:`p`,text:`Todos os meus relacionamentos eram bagunçados. Parecia que a mesma história sempre se repetia com pessoas diferentes e eu estava destinada a viver assim.`},{type:`p`,text:`Eu demorei muitos anos para descobrir como sair de um relacionamento abusivo e conseguir me relacionar de forma saudável.`},{type:`p`,text:`Hoje, você se sente assim?`},{type:`p`,text:`Está querendo sair de uma relação tóxica, mas por ainda gostar da pessoa, mesmo ela te fazendo tão mal, continua sem saber como conseguir sair…`},{type:`p`,text:`Ou até mesmo, não entende porque só consegue se relacionar com pessoas emocionalmente bagunçadas…`},{type:`p`,text:`Seja qual for o seu caso, eu sei disso porque eu também já estive na sua pele.`},{type:`p`,text:`Até conseguir enxergar o óbvio e ter uma relação saudável, eu vivi por muito tempo uma repetição de padrão. Todos os meus relacionamentos eram bagunçados e “abusivos” de alguma forma…`},{type:`p`,text:`Além disso, uma das perguntas que eu mais recebo é essa: Como sair de um relacionamento abusivo?`},{type:`p`,text:`Falar sobre esse tema é abrir espaço para reconhecer padrões, recuperar limites e construir relações mais saudáveis consigo mesma.`}]},{slug:`como-parar-de-depender-da-aprovacao-dos-outros`,title:`Seu valor não depende do aplauso`,excerpt:`Criar sem viver à mercê da aprovação é um exercício de consciência, presença e autonomia.`,cover:`/nadia/nadia-yoga-beach.webp`,date:`17 de abril de 2025`,blocks:[{type:`p`,text:`Você já sentiu aquele aperto no peito quando compartilha seu trabalho e ninguém parece notar?`},{type:`p`,text:`Já postou algo e ficou atualizando a tela para contar os likes?`},{type:`p`,text:`Já entregou um projeto no trabalho e ficou esperando os elogios?`},{type:`p`,text:`Eu já, muitas vezes. Confesso que já passei noites sem dormir ruminando o porquê das pessoas não elogiarem meu trabalho. Do porquê o feedback positivo não veio daquele projeto. Já postei textos, vídeos e fiquei medindo meu valor pelos números que apareciam na tela. E a verdade é que doía quando eles não vinham.`},{type:`p`,text:`A falta de apoio parece tão pessoal, tão íntima, que fere partes profundas de nós. Mas o que realmente dói não é o silêncio dos outros, e sim a conversa interna barulhenta que temos depois disso.`},{type:`p`,text:`O que dói não é a falta de aplausos, é a crença de que sem eles, não valemos nada.`},{type:`h2`,text:`A armadilha que está te prendendo`},{type:`p`,text:`O ser humano busca aprovação. Isso é parte da nossa biologia, não há nada errado nisso. O problema começa quando ancoramos nossa autoestima nesses sinais externos. O trabalho, para muitas de nós, virou uma vitrine onde expomos não apenas nossas habilidades, mas também nosso valor pessoal. E quando ninguém para para olhar essa vitrine, sentimos como se nós mesmas não fôssemos dignas de ser vistas.`},{type:`p`,text:`Seu trabalho é uma expressão do seu valor, não a fonte dele.`},{type:`p`,text:`Lembro de um período em que meu trabalho estava crescendo muito rápido. Os números subiam, os elogios chegavam, e eu me sentia no topo do mundo. Então veio uma crítica forte, pública, que questionava não apenas o que eu fazia, mas quem eu era. E tudo desmoronou. Foi aí que percebi: eu havia construído um castelo de areia. Se meu valor estava tão atrelado aos aplausos, o que aconteceria quando eles parassem de chegar?`},{type:`h2`,text:`A máscara perfeita (e a prisão que ela cria)`},{type:`p`,text:`A necessidade de aplausos raramente vem sozinha. Ela é apenas a ponta de um iceberg muito maior, cuja base está firmada nas suas inseguranças mais profundas. Ninguém usa máscara porque quer enganar os outros. As pessoas criam versões de si mesmas porque querem ser amadas.`},{type:`p`,text:`Quando você não acredita que quem você é, é suficiente para ser amada, você cria um personagem. E é aí que nasce a dependência dos aplausos – a dependência da validação do olhar do outro sobre nós.`},{type:`p`,text:`Para muitas de nós, o trabalho se tornou o substituto perfeito para o amor incondicional que, em algum momento da vida, sentimos que nos faltou.`},{type:`p`,text:`É mais fácil buscar reconhecimento profissional do que encarar aquela criança interna que ainda chora por atenção.`},{type:`p`,text:`Seu sucesso profissional nunca vai curar sua carência emocional. É como tentar encher um balde furado. Ganhar um prêmio é mais fácil que o trabalho interno de nos amarmos com nossas imperfeições. E assim, vamos trocando a cura real pela anestesia temporária que os aplausos proporcionam.`},{type:`h2`,text:`7 sinais de que você é refém dos aplausos`},{type:`p`,text:`Você está presa nessa armadilha? Veja se reconhece estes sinais:`},{type:`ul`,items:[`Você adia compartilhar seu trabalho até que esteja “perfeito”: Na verdade, você tem medo da rejeição.`,`Você fica devastada com críticas, mesmo as construtivas: Porque interpreta feedback como ataque pessoal.`,`Você checa constantemente as métricas do que posta: Como se aqueles números determinassem seu valor.`,`Você compara seu reconhecimento com o dos outros: E sempre se sente muito longe, não importa o que conquiste.`,`Você muda seu jeito e princípios para agradar os outros: Mesmo que isso signifique ser menos verdadeira.`,`Você diminui suas conquistas quando ninguém as celebra: Como se precisassem de validação dos outros para serem reais.`,`Você tem dificuldade de separar quem você é do que você faz: Quando seu trabalho falha, você se sente um fracasso como pessoa.`]},{type:`h2`,text:`O preço que você paga pela dependência de aplausos`},{type:`p`,text:`Quando você vive refém de validação dos outros, o preço é alto:`},{type:`ul`,items:[`Sua autenticidade é comprometida: Você cria o que acha que vai receber aplausos, não o que realmente acredita.`,`Sua criatividade fica limitada: O medo do julgamento corta as asas da sua versão mais original.`,`Sua alegria no processo desaparece: Você só consegue sentir prazer com o resultado, nunca com o caminho.`,`Sua relação com o trabalho se torna tóxica: Ele deixa de ser expressão e vira obrigação em performar e produzir.`,`Sua autoestima fica em constante montanha-russa: Subindo com os elogios, despencando com o silêncio.`]},{type:`p`,text:`O mais irônico? Quanto mais você depende desses aplausos, menos verdadeiro seu trabalho se torna. E trabalho pouco autêntico raramente recebe reconhecimento.`},{type:`h2`,text:`O que acontece quando ninguém te aplaude (e por que isso pode te salvar)`},{type:`p`,text:`Por incrível que pareça, foi quando menos apoio recebi que mais cresci. Porque quando não há plateia assistindo, você finalmente se pergunta: “Para quem estou realmente fazendo isso?”`},{type:`p`,text:`A ausência de aplausos pode ser o presente que te liberta para criar e viver a partir da sua essência.`},{type:`p`,text:`Notei que minhas melhores criações, aquelas que realmente tocaram pessoas, vieram quando parei de tentar impressionar os outros. Quando não estava mais calculando o quanto de aprovação aquele texto me traria, mas perguntando o quanto de verdade ele continha.`},{type:`h2`,text:`A raiz da máscara`},{type:`p`,text:`Agora, vamos a uma pergunta desconfortável: por que precisamos tanto que as pessoas batam palmas para versões irreais de nós?`},{type:`p`,text:`As redes sociais não inventaram as versões fantasiosas das pessoas, nem o uso de máscaras. Isso existe dentro da maioria das pessoas uma sensação de não ser boa o suficiente. Esta necessidade de validação tem raízes profundas:`},{type:`ul`,items:[`Amor condicional na infância: Quando crescemos sentindo que somos amados apenas quando performamos bem.`,`Desconexão da própria essência: Quando perdemos contato com nosso valor interno e verdadeiro, acreditamos que quem somos de verdade “não presta”.`,`Comparação: Quando medimos nosso valor em relação ao sucesso e a vida dos outros e sempre saímos perdendo.`,`Medo do abandono: Quando acreditamos que, sem produzir valor e receber aplausos, seremos deixados.`]},{type:`h2`,text:`Como se libertar da prisão dos aplausos`},{type:`p`,text:`Libertar sua autoestima da validação dos outros não acontece do dia para noite. É um processo. Mas aqui estão cinco passos que me ajudaram:`},{type:`ul`,items:[`Questione o padrão: Observe quando você está buscando validação e pergunte: “O que estou realmente buscando aqui? Que parte de mim precisa ser vista?”`,`Reconheça seu valor interno: Desenvolva práticas diárias de validação. Celebre seus esforços, não apenas seus resultados. Escreva para si mesmo o reconhecimento que você gostaria de receber dos outros.`,`Diversifique suas fontes de valor: Se todo seu senso de valor vem do trabalho, você estará sempre vulnerável. Cultive diferentes aspectos de si mesma.`,`Busque feedback, não validação: Feedback te ajuda a crescer; validação apenas alimenta temporariamente o ego. Aprenda a diferença entre os dois.`,`Crie a partir da abundância: Crie porque você transborda, não porque você está vazia. A criação que vem da plenitude tem uma energia completamente diferente.`]},{type:`p`,text:`O silêncio dos outros deixa de ser tão ensurdecedor quando você começa a ouvir e validar a sua própria voz.`},{type:`h2`,text:`A verdade sobre reconhecimento que ninguém te conta`},{type:`p`,text:`Quando você deixa de criar para impressionar e começa a criar a partir da sua verdade, quando você tira a máscara e se permite ser quem realmente é, o reconhecimento geralmente chega. Mas quando ele chega, você percebe que não precisa mais dele da mesma forma desesperada.`},{type:`p`,text:`O aplauso se torna uma celebração para compartilhar, não uma necessidade. Quando você para de sentir que “quem você é não presta” e começa a mostrar sua versão autêntica, algo mágico acontece: você atrai pessoas que te valorizam pelo que você realmente é, não pelo personagem que você criou.`},{type:`h2`,text:`Exercício: O Ritual do Desapego`},{type:`p`,text:`Aqui está um exercício prático para começar a se libertar:`},{type:`ul`,items:[`Escolha um projeto ou trabalho que você valoriza de verdade.`,`Compartilhe-o com o mundo sem expectativas de retorno.`,`Observe as emoções que surgem quando não há validação imediata.`,`Escreva para si mesma o reconhecimento que você gostaria de receber dos outros.`,`Conecte-se com o valor verdadeiro que o processo te trouxe, independente da reação dos outros.`]},{type:`p`,text:`Trago verdades: aplauso é um bônus, não uma necessidade. Seu valor vai muito além de qualquer reação que seu trabalho possa provocar.`}]},{slug:`poder-pessoal-define-conquistas-potencial-desejo`,title:`O desejo que aponta para o seu próximo passo`,excerpt:`Alguns desejos revelam possibilidades que pedem coragem, clareza e movimento.`,cover:`/nadia/yoga-sea.webp`,date:`20 de março de 2025`,blocks:[{type:`p`,text:`Você já se pegou desejando algo – uma mudança, uma conquista, uma sensação – mas logo em seguida pensou “isso não é para mim”?`},{type:`p`,text:`Esse desejo que aparece em você não é por acaso. É um sinal do seu potencial pedindo espaço, batendo na porta querendo sair. Mas você? Você segue ignorando. Você segue pequena. Segue deixando esse potencial aprisionado, quietinho. A verdade é que você nem percebe que está fazendo isso.`},{type:`p`,text:`Alguns sonhos não aceitam ficar guardados na gaveta.`},{type:`p`,text:`É por isso que, por mais que você siga ignorando o seu potencial, esse incômodo não passa. Esse desejo sempre insiste em voltar. Você tenta calá-lo, mas ele pulsa cada vez mais forte.`},{type:`h2`,text:`O poder que você tem (e nem sabe que tem)`},{type:`p`,text:`Poder pessoal não tem nada a ver com mandar nos outros ou ter cargo alto – exercer poder sobre alguém.`},{type:`p`,text:`Poder pessoal é simples: É quando você para de colocar sua vida nas mãos dos outros e começa a tomar as rédeas.`},{type:`p`,text:`É quando você decide que não vai mais:`},{type:`ul`,items:[`Esperar que alguém permita você brilhar`,`Viver no “mais tarde eu faço isso”`,`Aceitar menos do que merece`]},{type:`p`,text:`A maioria das pessoas não sabe o poder que tem dentro de si, e por isso ficam à mercê do mundo, como aquela folha que vai para onde o vento leva.`},{type:`p`,text:`Então, anota: você é o que pensa. Se a sua mentalidade for de coitadinha, é exatamente isso que você vai manifestar na sua vida – limitação, escassez e oportunidades perdidas. Essa mentalidade limitada é o que impede seu potencial de virar potência.`},{type:`p`,text:`Anota isso: potencial sem potência é puro desperdício. Você pode ter todo o talento do mundo, mas sem poder pessoal, esse talento fica enterrado.`},{type:`p`,text:`A pessoa mais poderosa não é a mais talentosa – é aquela que faz bom uso dos talentos que tem, aquela que transforma o que recebeu em algo maior.`},{type:`h2`,text:`Como saber se seu poder está dormindo`},{type:`p`,text:`Você precisa saber se seu poder está adormecido ou se está pulsando na sua vida. Por isso, aqui está uma sequência de sinais que vai te ajudar a identificar:`},{type:`p`,text:`Você sempre se desculpa`},{type:`p`,text:`Por falar, por existir, por pedir o que precisa. Como se você fosse um incômodo para o mundo.`},{type:`p`,text:`Você não confia nas suas decisões`},{type:`p`,text:`“O que você acha que eu devo fazer?” é uma pergunta que sai da sua boca com muita frequência`},{type:`p`,text:`Você vive no “pelo menos”`},{type:`ul`,items:[`“Pelo menos tenho um emprego, mesmo sendo infeliz nele.”`,`“Pelo menos ele não me trai, mesmo não me respeitando.”`]},{type:`p`,text:`Ninguém te vê ou te ouve de verdade`},{type:`p`,text:`Suas ideias são ignoradas, suas necessidades sempre ficam por último.`},{type:`p`,text:`Você mudou sonhos por “realidade”`},{type:`p`,text:`Não é que desistiu. Você só “cresceu” e ficou “realista”.`},{type:`p`,text:`Você sabe que está parada, mas tem medo de mudar`},{type:`p`,text:`Você repete dias ruins porque tem medo de arriscar dias melhores.`},{type:`p`,text:`Você sente inveja de quem se impõe`},{type:`p`,text:`Você sente inveja (e às vezes até julga) quem fala o que pensa e vai atrás do que quer.`},{type:`p`,text:`Se você se identificou com isso, seu poder não está apenas dormindo – está em coma. E você mesma que fez isso com ele.`},{type:`h2`,text:`O que você perde quando NÃO usa seu poder`},{type:`p`,text:`Quando você deixa seu poder adormecido, o preço é alto. E na maioria das vezes, você nem percebe que está pagando:`},{type:`p`,text:`Seu poder pessoal define o que você conquista. Quando você o deixa adormecido, você não permite que sua vida avance.`},{type:`p`,text:`E o pior: no fundo, você sabe que poderia ser diferente. Esse ‘’poderia’’ é o preço mais alto.`},{type:`h2`,text:`A parábola dos talentos: a lição que poucos entendem`},{type:`p`,text:`Existe uma parábola em Mateus que fala sobre um homem que, antes de viajar, chamou seus servos e confiou seus bens a eles. A um deu cinco talentos, a outro dois, a outro um – a cada um segundo a sua capacidade.`},{type:`p`,text:`O que recebeu cinco talentos negociou com eles e ganhou outros cinco. O que recebeu dois também conquistou outros dois.`},{type:`p`,text:`Mas o que recebeu um talento cavou na terra e escondeu o dinheiro do seu senhor.`},{type:`p`,text:`Quando o senhor voltou, elogiou os dois primeiros: “Muito bem, servo bom e fiel! Foste fiel no pouco, sobre o muito te colocarei.”`},{type:`p`,text:`Mas ao terceiro, que enterrou seu talento por medo, o senhor chamou de “servo mau e negligente” e tirou-lhe até o que tinha.`},{type:`p`,text:`A lição? A vida não te deu talentos para você enterrá-los. Ela espera multiplicação. E isso só acontece quando você desperta seu poder pessoal.`},{type:`p`,text:`O problema não é ter menos talentos que os outros. É não fazer nada com o que você tem.`},{type:`h2`,text:`A síndrome do “pelo menos” que está te deixando menor`},{type:`p`,text:`E sabe qual é a desculpa mais comum para não multiplicar seus talentos? A síndrome do “pelo menos”.`},{type:`p`,text:`Este mal silencioso que te convence a se contentar com menos do que você merece. A síndrome do ‘’pelo menos’’ é um pacto que você faz com a mediocridade. É aquela vozinha que te faz aceitar menos:`},{type:`p`,text:`“Meu trabalho me suga a alma, mas pelo menos é perto de casa.”`},{type:`p`,text:`Isso parece gratidão, mas não é. É você aceitando viver pela metade. A verdadeira gratidão diz: “Sou grata pelo que tenho E vou buscar o que mereço.”`},{type:`p`,text:`Quando você vive no “pelo menos”, você:`},{type:`ul`,items:[`Se diminui`,`Aceita migalhas emocionais`,`Vive no modo sobrevivência, nunca no modo abundância`,`Troca o que quer pelo que é fácil`]},{type:`p`,text:`Você é o que pensa. E uma mentalidade de “pelo menos” só pode criar uma vida morna, uma vida sem graça – uma vida onde seus talentos permanecem enterrados e seu potencial nunca vira potência.`},{type:`h2`,text:`Como despertar seu poder adormecido`},{type:`p`,text:`Vamos ser práticas. Não adianta eu te encher de teoria sobre poder pessoal se você não souber aplicar isso na sua vida. Então vamos ao que importa – como fazer seu poder acordar:`},{type:`ul`,items:[`Troque o “pelo menos” pelo “e também”`]},{type:`p`,text:`Exemplo:`},{type:`p`,text:`Antes: “Pelo menos tenho um emprego fixo.”`},{type:`p`,text:`Depois: “Tenho um emprego fixo, E TAMBÉM mereço um trabalho que me realize.”`},{type:`ul`,items:[`Pratique dizer “não”`]},{type:`p`,text:`Escolha uma coisa por dia para recusar – algo que você normalmente aceitaria só para agradar. Seu tempo é seu recurso mais valioso. Quem gasta ele por você?`},{type:`ul`,items:[`Pare de pedir opinião sobre a SUA vida`]},{type:`p`,text:`Da próxima vez que você quiser perguntar “o que você acha que eu devo fazer?”, PARE. Feche os olhos. Respire. E pergunte a si mesma: “O que EU quero fazer?”`},{type:`p`,text:`Sua intuição sabe a resposta. O problema é que você parou de ouvi-la.`},{type:`ul`,items:[`Avalie o seu círculo social`]},{type:`p`,text:`Quem está ao seu redor:`},{type:`ul`,items:[`Te puxa para cima ou para baixo?`,`Celebra seu crescimento ou tem inveja dele?`,`Te incentiva a arriscar ou a se manter no que é seguro e confortável?Seu poder pessoal é muito influenciado pelas pessoas mais próximas de você. Escolha bem.`,`Aja como protagonista, não como figurante`]},{type:`p`,text:`Em qualquer situação, pergunte: “Como a protagonista da minha vida agiria agora?”`},{type:`p`,text:`E então: faça isso. Você não é figurante na sua própria história. Para de se tratar como uma.`},{type:`h2`,text:`Onde não tem autoestima, não tem poder`},{type:`p`,text:`Muita gente confunde os dois, mas poder pessoal e autoestima são inseparáveis:`},{type:`ul`,items:[`Autoestima: É você saber que tem valor, ponto.`,`Poder pessoal: É agir a partir desse valor, sem pedir licença.`]},{type:`p`,text:`Um não vive sem o outro:`},{type:`ul`,items:[`Autoestima sem poder pessoal: Você sabe seu valor mas não consegue viver ele.`,`Poder pessoal sem autoestima: Você até conquista coisas, mas nunca se sente digna delas – e acaba sabotando tudo.`]},{type:`p`,text:`A boa notícia? Quando você trabalha um, o outro cresce junto:`},{type:`p`,text:`É um ciclo que, uma vez iniciado, só cresce.`},{type:`h2`,text:`A pergunta que não quer calar`},{type:`p`,text:`Agora, pare e responda com sinceridade:`},{type:`p`,text:`Se você acreditasse de verdade no seu potencial, que desejo você pararia de empurrar para baixo do tapete?`},{type:`ul`,items:[`Aquele negócio que você sonha abrir?`,`Aquele relacionamento que você sabe que merece?`,`Aquela mudança de carreira que você adia por medo?`,`Aquela conversa difícil que você não tem coragem de ter?`]},{type:`p`,text:`Todo desejo persistente está aí por um motivo. É uma semente que quer virar árvore.`},{type:`p`,text:`Quando você ignora seus desejos, você não está apenas adiando sua felicidade – está roubando do mundo a pessoa que você poderia se tornar.`},{type:`p`,text:`É mais um talento que você escolhe enterrar por medo, mais um potencial que nunca vira potência.`},{type:`p`,text:`Você é o que pensa. E a pergunta é simples: Você vai continuar criando uma realidade pela metade com sua mentalidade de “pelo menos”? Ou vai decidir, hoje, que merece o completo?`},{type:`h2`,text:`A pergunta que ninguém faz e deveria`},{type:`p`,text:`O que aconteceria se você despertasse seu poder agora? Não em cinco anos. Não quando seus filhos crescerem. Não quando você estiver “mais preparada”. Agora.`},{type:`p`,text:`💡 Trago verdades: Você já tem tudo que precisa. O que te falta não é capacidade, é decisão.`},{type:`p`,text:`E decisão é um músculo que se exercita todos os dias com pequenas escolhas:`},{type:`ul`,items:[`Escolher falar quando quer ficar quieta`,`Escolher pedir o que precisa em vez de esperar adivinhação`,`Escolher estabelecer limites mesmo quando tem medo de “magoar” o outro`]},{type:`p`,text:`O poder pessoal não é algo que você descobre – é algo que você decide exercer.`},{type:`p`,text:`Não é sobre tentar calar o que pulsa em você. É sobre se tornar tão grande que você consegue viver aquilo que pulsa.`},{type:`p`,text:`Seu poder está aí. Sempre esteve. Você só precisa despertá-lo.`}]},{slug:`adultos-mimados-magoa-birra-imaturidade-emocional`,title:`Maturidade emocional começa onde a birra termina`,excerpt:`Mágoas e expectativas podem ser observadas com honestidade para abrir caminho a escolhas mais maduras.`,cover:`/nadia/nadia-garden.webp`,date:null,blocks:[{type:`p`,text:`Existe uma criança aí dentro de você. Uma criança que ainda faz birra quando é desagradada. Sobre esse pedacinho em você que ainda acha que o mundo tem que pisar em ovos para não te machucar — é disso que vamos falar hoje. E eu já sei que você não vai gostar.`},{type:`h2`,text:`A ilusão da maturidade`},{type:`p`,text:`Eu costumo dizer que existem os adultos mimados e os adultos maduros. Até porque crescer não significa amadurecer. Eu não sei qual é a idade que está marcada lá na sua carteira de identidade, mas eu sei que o seu emocional para ser desenvolvido e para chegar à verdadeira maturidade vai precisar de uma decisão.`},{type:`p`,text:`A decisão de se tornar uma adulta madura.`},{type:`p`,text:`Não é porque você comemorou muitos aniversários que a maturidade veio. Aliás, o que mais existe por aí são adultos mimados. Pessoas que cresceram, que têm idade, mas que ainda não conquistaram maturidade.`},{type:`h2`,text:`A criança interior que você carrega`},{type:`p`,text:`Você já se perguntou o que acontece quando alguém te desagrada? Você faz birra, mesmo que seja uma birra apenas dentro de você? O que é que acontece quando as coisas não saem conforme você esperava? Você fica nervosa? Você tem vontade de sentar e chorar? Ou você é a pessoa que se levanta para solucionar?`},{type:`p`,text:`Pergunto tudo isso porque eu também era uma adulta mimada, e nem sabia. Até que um dia me disseram que a mágoa era a “birra” dos fracos. Fiquei p* porque essa afirmação me colocava, portanto, como uma pessoa fraca. Logo eu, que sempre me achei tão forte.`},{type:`p`,text:`Fui lembrando num efeito cascata vários episódios de mágoa e percebi um padrão: a mágoa sempre aparecia quando alguém não fazia o que eu queria! Putz! Eu era mimada, e nem sabia.`},{type:`h2`,text:`Sobre essa expectativa infantil que você ainda carrega`},{type:`p`,text:`Você não vai gostar do que vou te falar, mas vou dizer mesmo assim:`},{type:`p`,text:`A mágoa é, sim, uma birra. Uma chantagem emocional sutil para punir e culpar o outro por não ser e agir como nós preferimos.`},{type:`p`,text:`E depois de ler isso aqui você vai me odiar porque nunca mais você vai conseguir ficar magoado sem se perguntar: “qual parte de mim foi desagradada?” Essa expectativa infantil que você ainda carrega de que as pessoas têm que te fazer aquilo que nem você se dispôs a conquistar é o que te mantém no lugar de vítima.`},{type:`p`,text:`Se alguém é agressivo, explosivo, maldoso… você realmente acha que isso tem a ver com você? As pessoas transbordam o que sobra dentro delas. Quem está ferido → fere. Quem está machucado → machuca.`},{type:`p`,text:`O que te magoa não é quem o outro é. É a expectativa que você tem de como o outro deveria ser. De como ele deveria agir com você.`},{type:`h2`,text:`“Mas e quando o outro está errado?”`},{type:`p`,text:`Vamos considerar esses casos em que o outro é agressivo e/ou cruel e que escolheu a dedo as palavras com a intenção pensada por anos para te ferir. Minha resposta é: não! Porque o outro é livre.`},{type:`ul`,items:[`Livre para não ter por você o mesmo respeito e carinho que você tem por ele.`,`Livre para não te fazer o favor que você pediu.`,`Livre para não falar com você de forma gentil.`,`Livre para não gostar de você.`,`Livre, até, para ser um fdp!`]},{type:`p`,text:`Mas já parou para pensar que você também é livre? Livre, inclusive, para escolher não conviver com essa pessoa, ou para mudar ela de prateleira, na sua vida.`},{type:`h2`,text:`Você escolhe o seu sofrimento`},{type:`p`,text:`Quando você escolhe ficar magoado, não só você age feito um adulto mimado, como você cria um problema para você. É como se o outro produzisse a causa, e você escolhesse pagar o preço. Afinal, a mágoa que você sente não vai nem mudar o outro, e nem te amadurecer.`},{type:`p`,text:`Em última instância, a única finalidade dela vai ser te fazer sofrer. Você não é o centro do mundo, baby! Se você parar de acreditar que é sobre você, você vai parar de sentir mágoa e vai sentir compaixão.`},{type:`h2`,text:`A maturidade é uma decisão`},{type:`p`,text:`A vida fica mais leve quando você decide amadurecer, quando você para de exigir que o mundo se adapte a você e começa a se adaptar à realidade do mundo.`},{type:`p`,text:`Amadurecer significa:`},{type:`ul`,items:[`Assumir responsabilidade: pelos seus sentimentos e suas reações, em vez de culpar os outros`,`Estabelecer limites: sem drama e sem vitimismo`,`Lidar com desapontamentos: sem transformá-los em mágoas permanentes`,`Praticar compaixão: entender que o comportamento do outro fala mais sobre ele do que sobre você`,`Escolher suas batalhas: nem tudo merece sua energia emocional`]},{type:`p`,text:`Você é livre para continuar com suas mágoas. Mas lembre-se: elas só afetam você. Vale a pena? A questão não é se você vai ser desagradada nessa vida — porque você vai. A questão é: como você vai reagir quando isso acontecer?`},{type:`h2`,text:`Quer ir mais fundo nesse tema?`},{type:`p`,text:`Observe, ao longo da semana, quais expectativas surgem quando alguém não age como você gostaria. Nomear o que sente é um primeiro passo para responder com mais maturidade emocional.`},{type:`h2`,text:`Para continuar a reflexão`},{type:`p`,text:`Que expectativa você está pronta para deixar ir? E que escolha mais consciente pode nascer a partir dessa resposta?`},{type:`p`,text:`A maturidade emocional não exige perfeição. Ela começa quando você troca a reação automática por uma presença capaz de escolher.`}]}],Dy=e=>Ey.find(t=>t.slug===e),Oy=Pc(`/artigos/$slug`)({loader:({params:e})=>{let t=Dy(e.slug);if(!t)throw st();return{article:t}},head:({loaderData:e})=>{if(!e)return{meta:[{title:`Artigo não encontrado`},{name:`robots`,content:`noindex`}]};let{article:t}=e,n=`${t.title} — Nadia Oliver`;return{meta:[{title:n},{name:`description`,content:t.excerpt},{property:`og:title`,content:n},{property:`og:description`,content:t.excerpt},{property:`og:type`,content:`article`},{name:`twitter:card`,content:`summary_large_image`}]}},component:Ic(()=>Fv(()=>import(`./artigos._slug-CioU47Sw.js`),[]),`component`)}),ky={IndexRoute:zv.update({id:`/`,path:`/`,getParentRoute:()=>kv}),AvisoLegalRoute:Uv.update({id:`/aviso-legal`,path:`/aviso-legal`,getParentRoute:()=>kv}),BlogRoute:qv.update({id:`/blog`,path:`/blog`,getParentRoute:()=>kv}),ContatoRoute:Zv.update({id:`/contato`,path:`/contato`,getParentRoute:()=>kv}),LojaRoute:ty.update({id:`/loja`,path:`/loja`,getParentRoute:()=>kv}),MentoriasRoute:ay.update({id:`/mentorias`,path:`/mentorias`,getParentRoute:()=>kv}),PoliticaDePrivacidadeRoute:ly.update({id:`/politica-de-privacidade`,path:`/politica-de-privacidade`,getParentRoute:()=>kv}),SobreRoute:py.update({id:`/sobre`,path:`/sobre`,getParentRoute:()=>kv}),TerapiasRoute:_y.update({id:`/terapias`,path:`/terapias`,getParentRoute:()=>kv}),TermosDeUsoRoute:xy.update({id:`/termos-de-uso`,path:`/termos-de-uso`,getParentRoute:()=>kv}),YogaterapiaRoute:Ty.update({id:`/yogaterapia`,path:`/yogaterapia`,getParentRoute:()=>kv}),ArtigosSlugRoute:Oy.update({id:`/artigos/$slug`,path:`/artigos/$slug`,getParentRoute:()=>kv})},Ay=kv._addFileChildren(ky),jy=()=>Qc({routeTree:Ay,context:{queryClient:new dg},scrollRestoration:!0,defaultPreloadStaleTime:0});async function My(){let e=await jy(),t;if(fh){let n=await fh.getOptions();n.serializationAdapters=n.serializationAdapters??[],window.__TSS_START_OPTIONS__=n,t=n.serializationAdapters,e.options.defaultSsr=n.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(ds),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await ms(e),e}var Ny=My;async function Py(){let e=await Ny();return window.$_TSR?.h(),e}var Fy;function Iy(){return Fy||=Py(),(0,R.jsx)(Cs,{promise:Fy,children:e=>(0,R.jsx)(tl,{router:e})})}var Ly=g();(0,L.startTransition)(()=>{(0,Ly.hydrateRoot)(document,(0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(Iy,{})}))});export{ch as A,Q_ as C,K_ as D,J_ as E,xs as M,u as N,W_ as O,c as P,G_ as S,$_ as T,yv as _,pv as a,gv as b,xv as c,mv as d,av as f,_v as g,vv as h,uv as i,Dc as j,gg as k,iv as l,cv as m,Ey as n,hv as o,ov as p,sv as r,lv as s,Oy as t,fv as u,ev as v,q_ as w,bv as x,dv as y};